Class: SimulatorTimeline::Period
- Inherits:
-
Object
- Object
- SimulatorTimeline::Period
- Defined in:
- app/models/simulator_timeline/period.rb
Instance Method Summary collapse
- #at(minute, &block) ⇒ Object
-
#initialize(timeline, period, options = {}) ⇒ Period
constructor
A new instance of Period.
- #period_time ⇒ Object
Constructor Details
#initialize(timeline, period, options = {}) ⇒ Period
Returns a new instance of Period.
3 4 5 6 |
# File 'app/models/simulator_timeline/period.rb', line 3 def initialize(timeline, period, ={}) @timeline, @period = timeline, period add_narration() if @timeline.current_period_time >= period_time end |
Instance Method Details
#at(minute, &block) ⇒ Object
12 13 14 |
# File 'app/models/simulator_timeline/period.rb', line 12 def at(minute, &block) Minute.new @timeline, period_time, minute, &block end |
#period_time ⇒ Object
8 9 10 |
# File 'app/models/simulator_timeline/period.rb', line 8 def period_time SimulatorMatch::STATUS_SEQUENCE[@period] || @period.to_i end |