Class: Musa::Datasets::P::PtoTimedSerie Private

Inherits:
Object
  • Object
show all
Defined in:
lib/musa-dsl/datasets/p.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Series adapter for P to AbsTimed conversion.

PtoTimedSerie is a Series::Serie that converts a Musa::Datasets::P (point series) into a series of AbsTimed events. It reads the alternating point/duration structure and emits timed events.

This class is created by #to_timed_serie and should not be instantiated directly.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(origin, base_duration, time_start) ⇒ PtoTimedSerie

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Creates new timed serie adapter.

Parameters:

  • origin (P)

    source point series

  • base_duration (Rational)

    duration unit multiplier

  • time_start (Numeric)

    starting time offset



218
219
220
221
222
223
224
225
226
# File 'lib/musa-dsl/datasets/p.rb', line 218

def initialize(origin, base_duration, time_start)
  @origin = origin
  @base_duration = base_duration
  @time_start = time_start

  init

  mark_as_prototype!
end

Instance Attribute Details

#base_durationRational

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Duration unit multiplier.

Returns:



234
235
236
# File 'lib/musa-dsl/datasets/p.rb', line 234

def base_duration
  @base_duration
end

#originP

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Source point series.

Returns:

  • (P)


230
231
232
# File 'lib/musa-dsl/datasets/p.rb', line 230

def origin
  @origin
end

#time_startNumeric

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Starting time offset.

Returns:

  • (Numeric)


238
239
240
# File 'lib/musa-dsl/datasets/p.rb', line 238

def time_start
  @time_start
end