Class: HotCocoa::TableDataSource
- Defined in:
- lib/hotcocoa/data_sources/table_data_source.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(data) ⇒ TableDataSource
constructor
A new instance of TableDataSource.
- #numberOfRowsInTableView(tableView) ⇒ Object
- #tableView(view, objectValueForTableColumn: column, row: i) ⇒ Object
Constructor Details
#initialize(data) ⇒ TableDataSource
Returns a new instance of TableDataSource.
5 6 7 |
# File 'lib/hotcocoa/data_sources/table_data_source.rb', line 5 def initialize data @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/hotcocoa/data_sources/table_data_source.rb', line 3 def data @data end |
Instance Method Details
#numberOfRowsInTableView(tableView) ⇒ Object
9 10 11 |
# File 'lib/hotcocoa/data_sources/table_data_source.rb', line 9 def numberOfRowsInTableView tableView data.length end |
#tableView(view, objectValueForTableColumn: column, row: i) ⇒ Object
13 14 15 |
# File 'lib/hotcocoa/data_sources/table_data_source.rb', line 13 def tableView view, objectValueForTableColumn: column, row: i data[i][column.identifier.intern] end |