Class: Termtable::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/termtable/header.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cellsObject (readonly)

Returns the value of attribute cells.



3
4
5
# File 'lib/termtable/header.rb', line 3

def cells
  @cells
end

Instance Method Details

#renderObject



9
10
11
# File 'lib/termtable/header.rb', line 9

def render
  '|' + cells.map(&:render).join('|') << '|'
end