Class: SimulatorTimeline::Event
- Inherits:
-
Object
- Object
- SimulatorTimeline::Event
- Defined in:
- app/models/simulator_timeline/event.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#event_handler ⇒ Object
readonly
Returns the value of attribute event_handler.
-
#minute ⇒ Object
readonly
Returns the value of attribute minute.
-
#period_time ⇒ Object
readonly
Returns the value of attribute period_time.
Class Method Summary collapse
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(event_handler, timeline, period_time, minute, options = {}) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(event_handler, timeline, period_time, minute, options = {}) ⇒ Event
Returns a new instance of Event.
5 6 7 8 |
# File 'app/models/simulator_timeline/event.rb', line 5 def initialize(event_handler, timeline, period_time, minute, = {}) @event_handler, @timeline, @period_time, @minute = event_handler, timeline, period_time, minute apply_event end |
Instance Attribute Details
#event_handler ⇒ Object (readonly)
Returns the value of attribute event_handler.
3 4 5 |
# File 'app/models/simulator_timeline/event.rb', line 3 def event_handler @event_handler end |
#minute ⇒ Object (readonly)
Returns the value of attribute minute.
3 4 5 |
# File 'app/models/simulator_timeline/event.rb', line 3 def minute @minute end |
#period_time ⇒ Object (readonly)
Returns the value of attribute period_time.
3 4 5 |
# File 'app/models/simulator_timeline/event.rb', line 3 def period_time @period_time end |
Class Method Details
.fuck_collection(key, collection) ⇒ Object
Yeah… FootStats fucks collection…
15 16 17 18 19 20 21 22 23 24 |
# File 'app/models/simulator_timeline/event.rb', line 15 def self.fuck_collection(key, collection) case collection.size when 0 nil when 1 { key => collection.first } else { key => collection } end end |
Instance Method Details
#<=>(other) ⇒ Object
10 11 12 |
# File 'app/models/simulator_timeline/event.rb', line 10 def <=>(other) [@period_time, @minute] <=> [other.period_time, other.minute] end |