Class: DmmUtil::RecordingMeasurementCursor
- Inherits:
-
Object
- Object
- DmmUtil::RecordingMeasurementCursor
- Includes:
- Enumerable
- Defined in:
- lib/dmm_util/recording_measurement_cursor.rb
Instance Method Summary collapse
- #[](idx) ⇒ Object
- #count ⇒ Object
- #each ⇒ Object
-
#initialize(driver, recording) ⇒ RecordingMeasurementCursor
constructor
A new instance of RecordingMeasurementCursor.
Constructor Details
#initialize(driver, recording) ⇒ RecordingMeasurementCursor
Returns a new instance of RecordingMeasurementCursor.
6 7 8 9 |
# File 'lib/dmm_util/recording_measurement_cursor.rb', line 6 def initialize(driver, recording) @driver = driver @recording = recording end |
Instance Method Details
#[](idx) ⇒ Object
21 22 23 |
# File 'lib/dmm_util/recording_measurement_cursor.rb', line 21 def [](idx) RecordingMeasurement.new(@driver.qsrr(@recording.raw[:reading_index] ,idx)) end |
#count ⇒ Object
11 12 13 |
# File 'lib/dmm_util/recording_measurement_cursor.rb', line 11 def count @recording.num_samples end |
#each ⇒ Object
15 16 17 18 19 |
# File 'lib/dmm_util/recording_measurement_cursor.rb', line 15 def each (0..(count-1)).each do |idx| yield(self[idx]) end end |