Class: TextLayout::Table::Cell
- Inherits:
-
Struct
- Object
- Struct
- TextLayout::Table::Cell
- Defined in:
- lib/text_layout/table.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attr ⇒ Object
Returns the value of attribute attr.
-
#col ⇒ Object
Returns the value of attribute col.
-
#row ⇒ Object
Returns the value of attribute row.
Instance Method Summary collapse
Instance Attribute Details
#attr ⇒ Object
Returns the value of attribute attr
30 31 32 |
# File 'lib/text_layout/table.rb', line 30 def attr @attr end |
#col ⇒ Object
Returns the value of attribute col
30 31 32 |
# File 'lib/text_layout/table.rb', line 30 def col @col end |
#row ⇒ Object
Returns the value of attribute row
30 31 32 |
# File 'lib/text_layout/table.rb', line 30 def row @row end |
Instance Method Details
#height ⇒ Object
35 36 37 |
# File 'lib/text_layout/table.rb', line 35 def height [attr[:value].size, 1].max end |
#width ⇒ Object
31 32 33 |
# File 'lib/text_layout/table.rb', line 31 def width attr[:value].map(&:display_width).max || 0 end |