Class: Tableview::ViewHandler::Part

Inherits:
TablePiece show all
Defined in:
lib/tableview/view_handler.rb

Direct Known Subclasses

Body, Footer, Header

Instance Attribute Summary collapse

Attributes inherited from TablePiece

#options

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Part

Returns a new instance of Part.



146
147
148
149
# File 'lib/tableview/view_handler.rb', line 146

def initialize(*args)
  super *args
  self.rows = []
end

Instance Attribute Details

#rowsObject

Returns the value of attribute rows.



145
146
147
# File 'lib/tableview/view_handler.rb', line 145

def rows
  @rows
end

Instance Method Details

#row(opts = {}) {|row| ... } ⇒ Object

Yields:



151
152
153
154
155
# File 'lib/tableview/view_handler.rb', line 151

def row(opts = {}, &block)
  row = Row.new opts
  yield row
  self.rows << row
end