Class: Railbow::Table::Column
- Inherits:
-
Object
- Object
- Railbow::Table::Column
- Defined in:
- lib/railbow/table/column.rb
Instance Attribute Summary collapse
-
#accent ⇒ Object
readonly
Returns the value of attribute accent.
-
#aliased ⇒ Object
readonly
Returns the value of attribute aliased.
-
#align ⇒ Object
readonly
Returns the value of attribute align.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#max_width ⇒ Object
readonly
Returns the value of attribute max_width.
-
#min_width ⇒ Object
readonly
Returns the value of attribute min_width.
-
#sticky ⇒ Object
readonly
Returns the value of attribute sticky.
-
#truncate ⇒ Object
readonly
Returns the value of attribute truncate.
-
#truncate_fn ⇒ Object
readonly
Returns the value of attribute truncate_fn.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #fixed? ⇒ Boolean
-
#initialize(label:, width: :auto, min_width: nil, max_width: nil, align: :left, truncate: false, truncate_fn: nil, sticky: false, accent: false, aliased: true) ⇒ Column
constructor
accent: the column carries its own meaning through color (a status glyph, say), so it keeps that color when the row is dimmed.
Constructor Details
#initialize(label:, width: :auto, min_width: nil, max_width: nil, align: :left, truncate: false, truncate_fn: nil, sticky: false, accent: false, aliased: true) ⇒ Column
accent: the column carries its own meaning through color (a status glyph, say), so it keeps that color when the row is dimmed. aliased: value aliases from config may rewrite this column's cells. Off for cells the caller already resolved, such as a cluster of status glyphs, which no whole-cell alias could ever match.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/railbow/table/column.rb', line 14 def initialize(label:, width: :auto, min_width: nil, max_width: nil, align: :left, truncate: false, truncate_fn: nil, sticky: false, accent: false, aliased: true) @label = label @width = width @min_width = min_width @max_width = max_width @align = align @truncate = truncate @truncate_fn = truncate_fn @sticky = sticky @accent = accent @aliased = aliased end |
Instance Attribute Details
#accent ⇒ Object (readonly)
Returns the value of attribute accent.
6 7 8 |
# File 'lib/railbow/table/column.rb', line 6 def accent @accent end |
#aliased ⇒ Object (readonly)
Returns the value of attribute aliased.
6 7 8 |
# File 'lib/railbow/table/column.rb', line 6 def aliased @aliased end |
#align ⇒ Object (readonly)
Returns the value of attribute align.
6 7 8 |
# File 'lib/railbow/table/column.rb', line 6 def align @align end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
6 7 8 |
# File 'lib/railbow/table/column.rb', line 6 def label @label end |
#max_width ⇒ Object (readonly)
Returns the value of attribute max_width.
6 7 8 |
# File 'lib/railbow/table/column.rb', line 6 def max_width @max_width end |
#min_width ⇒ Object (readonly)
Returns the value of attribute min_width.
6 7 8 |
# File 'lib/railbow/table/column.rb', line 6 def min_width @min_width end |
#sticky ⇒ Object (readonly)
Returns the value of attribute sticky.
6 7 8 |
# File 'lib/railbow/table/column.rb', line 6 def sticky @sticky end |
#truncate ⇒ Object (readonly)
Returns the value of attribute truncate.
6 7 8 |
# File 'lib/railbow/table/column.rb', line 6 def truncate @truncate end |
#truncate_fn ⇒ Object (readonly)
Returns the value of attribute truncate_fn.
6 7 8 |
# File 'lib/railbow/table/column.rb', line 6 def truncate_fn @truncate_fn end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
6 7 8 |
# File 'lib/railbow/table/column.rb', line 6 def width @width end |
Instance Method Details
#fixed? ⇒ Boolean
27 28 29 |
# File 'lib/railbow/table/column.rb', line 27 def fixed? width.is_a?(Integer) end |