module AsanaExceptionNotifier::HeredocHelper

helper methods that use Heredoc syntax

Public Instance Methods

mount_table(array, options = {}) click to toggle source

Gets a bidimensional array and create a table. The first array is used as label. @param [Array<Array<String>>] array The array of arrays of strings that will be used for constructing the HTML table @param [Hash] options The options list that will be used to construct the HTML attributes on the HTML table

@return [String] returns the HTML table that was generated from the received array

# File lib/asana_exception_notifier/helpers/heredoc_helper.rb, line 23
    def mount_table(array, options = {})
      header = array.extract_options!
      <<-HTML
      <table #{hash_to_html_attributes(options)}>
        <thead><tr><th>#{get_table_headers(header)}</th></tr></thead>
        <tbody>#{get_table_rows(array)}</tbody>
      </table>
      HTML
    end