Class: ColorfulTables::Column
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :data_color => :light_blue, :header_color => :light_blue, :digits_after_decimal_point => 4 }
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#header ⇒ Object
Returns the value of attribute header.
-
#options ⇒ Object
Returns the value of attribute options.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(header, data, options = {}) ⇒ Column
constructor
A new instance of Column.
Constructor Details
#initialize(header, data, options = {}) ⇒ Column
Returns a new instance of Column.
15 16 17 18 19 20 |
# File 'lib/colorful_tables/column.rb', line 15 def initialize(header, data, = {}) @header = header @data = data @options = .reverse_merge!(DEFAULT_OPTIONS) @width ||= calculate_width end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
11 12 13 |
# File 'lib/colorful_tables/column.rb', line 11 def data @data end |
#header ⇒ Object
Returns the value of attribute header.
11 12 13 |
# File 'lib/colorful_tables/column.rb', line 11 def header @header end |
#options ⇒ Object
Returns the value of attribute options.
11 12 13 |
# File 'lib/colorful_tables/column.rb', line 11 def @options end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
13 14 15 |
# File 'lib/colorful_tables/column.rb', line 13 def width @width end |