Class: DmmUtil::RecordingMeasurementCursor

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/dmm_util/recording_measurement_cursor.rb

Instance Method Summary collapse

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

#countObject



11
12
13
# File 'lib/dmm_util/recording_measurement_cursor.rb', line 11

def count
  @recording.num_samples
end

#eachObject



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