Class: PPCurses::SingleColumnDataSource
- Inherits:
-
Object
- Object
- PPCurses::SingleColumnDataSource
- Defined in:
- lib/ppcurses/table_view.rb
Overview
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(values) ⇒ SingleColumnDataSource
constructor
A new instance of SingleColumnDataSource.
-
#number_of_rows_in_table(aTableView) ⇒ Object
Returns the number of records managed for aTableView by the data source object.
-
#object_value_for(aTableview, column, row_index) ⇒ Object
Called by the table view to return the data object associated with the specified row and column.
Constructor Details
#initialize(values) ⇒ SingleColumnDataSource
Returns a new instance of SingleColumnDataSource.
176 177 178 |
# File 'lib/ppcurses/table_view.rb', line 176 def initialize(values) @values = values end |
Instance Method Details
#number_of_rows_in_table(aTableView) ⇒ Object
Returns the number of records managed for aTableView by the data source object.
182 183 184 |
# File 'lib/ppcurses/table_view.rb', line 182 def number_of_rows_in_table( aTableView) @values.length end |
#object_value_for(aTableview, column, row_index) ⇒ Object
Called by the table view to return the data object associated with the specified row and column.
188 189 190 191 192 193 194 |
# File 'lib/ppcurses/table_view.rb', line 188 def object_value_for(aTableview, column, row_index) if column > 0 then return nil end @values[row_index] end |