Class: Termtable::Header
- Inherits:
-
Object
- Object
- Termtable::Header
- Defined in:
- lib/termtable/header.rb
Instance Attribute Summary collapse
-
#cells ⇒ Object
readonly
Returns the value of attribute cells.
Instance Method Summary collapse
-
#initialize(header) ⇒ Header
constructor
A new instance of Header.
- #render ⇒ Object
Constructor Details
#initialize(header) ⇒ Header
Returns a new instance of Header.
5 6 7 |
# File 'lib/termtable/header.rb', line 5 def initialize(header) @cells = header.map { |value| Cell.new(value) } end |
Instance Attribute Details
#cells ⇒ Object (readonly)
Returns the value of attribute cells.
3 4 5 |
# File 'lib/termtable/header.rb', line 3 def cells @cells end |
Instance Method Details
#render ⇒ Object
9 10 11 |
# File 'lib/termtable/header.rb', line 9 def render '|' + cells.map(&:render).join('|') << '|' end |