Class: Terminal::Table::Cell
Direct Known Subclasses
Instance Attribute Summary collapse
-
#alignment ⇒ Object
Returns the value of attribute alignment.
-
#colspan ⇒ Object
Returns the value of attribute colspan.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(width, params) ⇒ Cell
constructor
A new instance of Cell.
- #length ⇒ Object
- #render ⇒ Object (also: #to_s)
Constructor Details
#initialize(width, params) ⇒ Cell
Returns a new instance of Cell.
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/terminal-table/cell.rb', line 8 def initialize width, params @width = width @alignment = :left @colspan = 1 if params.is_a? Hash @value = params[:value] @alignment = params[:alignment] unless params[:alignment].nil? @colspan = params[:colspan] unless params[:colspan].nil? else @value = params end end |
Instance Attribute Details
#alignment ⇒ Object
Returns the value of attribute alignment.
6 7 8 |
# File 'lib/terminal-table/cell.rb', line 6 def alignment @alignment end |
#colspan ⇒ Object
Returns the value of attribute colspan.
6 7 8 |
# File 'lib/terminal-table/cell.rb', line 6 def colspan @colspan end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/terminal-table/cell.rb', line 6 def value @value end |