Class: Hirb::Helpers::TabTable
- Defined in:
- lib/hirb/helpers/tab_table.rb
Constant Summary collapse
- DELIM =
"\t"
Constants inherited from Table
Hirb::Helpers::Table::BORDER_LENGTH, Hirb::Helpers::Table::CHARS, Hirb::Helpers::Table::MIN_FIELD_LENGTH
Instance Attribute Summary
Attributes inherited from Table
#field_lengths, #fields, #max_fields, #width
Class Method Summary collapse
-
.render(rows, options = {}) ⇒ Object
Renders a tab-delimited table.
Instance Method Summary collapse
Methods inherited from Table
#actual_width, #array_to_indices_hash, #call_filter, #chars, choose_style, #default_field_lengths, #enforce_field_constraints, #filter_values, #format_cell, #format_values, #initialize, #render, #render_border, #render_table_description, #set_fields, #set_filter_defaults, #set_headers, #set_rows, #setup_field_lengths, #validate_values
Constructor Details
This class inherits a constructor from Hirb::Helpers::Table
Class Method Details
.render(rows, options = {}) ⇒ Object
Renders a tab-delimited table
5 6 7 |
# File 'lib/hirb/helpers/tab_table.rb', line 5 def self.render(rows, ={}) new(rows, {:description => false}.merge()).render end |
Instance Method Details
#render_footer ⇒ Object
21 22 23 |
# File 'lib/hirb/helpers/tab_table.rb', line 21 def [] end |
#render_header ⇒ Object
9 10 11 |
# File 'lib/hirb/helpers/tab_table.rb', line 9 def render_header @headers ? render_table_header : [] end |
#render_rows ⇒ Object
17 18 19 |
# File 'lib/hirb/helpers/tab_table.rb', line 17 def render_rows @rows.map { |row| format_values(row).join(DELIM) } end |
#render_table_header ⇒ Object
13 14 15 |
# File 'lib/hirb/helpers/tab_table.rb', line 13 def render_table_header [ format_values(@headers).join(DELIM) ] end |