Class: TorQML::DataSources::MatrixDataSource_rb
- Inherits:
-
DataSource_rb
- Object
- DataSource_rb
- TorQML::DataSources::MatrixDataSource_rb
- Defined in:
- lib/torqml/datasources/matrixdatasource.rb
Overview
Base class of matrix type data sources.
Direct Known Subclasses
Instance Method Summary collapse
-
#rows ⇒ Integer
Returns the number of rows.
-
#value_at(index) ⇒ Float
Returns the current frame value at column index.
Methods inherited from DataSource_rb
Instance Method Details
#rows ⇒ Integer
Returns the number of rows.
29 30 31 |
# File 'lib/torqml/datasources/matrixdatasource.rb', line 29 def rows @data.length end |
#value_at(index) ⇒ Float
Returns the current frame value at column index.
17 18 19 20 21 22 23 24 |
# File 'lib/torqml/datasources/matrixdatasource.rb', line 17 def value_at(index) if @data.nil? raise "data not initialized" 0 else @data[currentFrame.to_i - 1][index.to_i] end end |