Class: SimpleTable::Cell
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Attributes inherited from Tag
Instance Method Summary collapse
-
#initialize(parent, content = nil, options = {}) ⇒ Cell
constructor
A new instance of Cell.
- #render ⇒ Object
- #tag_name ⇒ Object
Methods inherited from Tag
#add_class, #collection_class, #collection_name, #head?, #table
Constructor Details
#initialize(parent, content = nil, options = {}) ⇒ Cell
Returns a new instance of Cell.
7 8 9 10 11 |
# File 'lib/simple_table/cell.rb', line 7 def initialize(parent, content = nil, = {}) super(parent, ) @content = content [:colspan] = table.columns.size if [:colspan] == :all end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
5 6 7 |
# File 'lib/simple_table/cell.rb', line 5 def content @content end |
Instance Method Details
#render ⇒ Object
13 14 15 |
# File 'lib/simple_table/cell.rb', line 13 def render super(content, true) end |
#tag_name ⇒ Object
17 18 19 |
# File 'lib/simple_table/cell.rb', line 17 def tag_name parent.head? ? :th : :td end |