Class: ObjectView::TRow

Inherits:
Element
  • Object
show all
Defined in:
lib/object_view/table.rb

Direct Known Subclasses

THeadRow

Instance Attribute Summary

Attributes inherited from Element

#acceptable_children, #children, #single_line, #tag

Instance Method Summary collapse

Methods inherited from Element

#<<, #add, #add_with_tag, #attr, #attributes, #css_class=, #find_element_with_tag, #id=, #is_acceptable_child?, #on_click=, #render, #render_attributes, #render_children, #style, #style=

Constructor Details

#initializeTRow

Returns a new instance of TRow.



78
79
80
81
82
# File 'lib/object_view/table.rb', line 78

def initialize
  super()
  @tag = "tr"
  self.acceptable_children = [TCell, THeadCell]
end

Instance Method Details

#cell(content = nil) ⇒ Object



84
85
86
87
88
89
90
91
# File 'lib/object_view/table.rb', line 84

def cell(content = nil)
  cell = TCell.new
  if (content != nil)
    cell.add content
  end
  self.add cell
  return cell
end