Class: LolApi::Frame
- Inherits:
-
Object
- Object
- LolApi::Frame
- Defined in:
- lib/lol_api/types/dtos/timeline.rb
Instance Attribute Summary collapse
-
#raw_frame ⇒ Object
readonly
Returns the value of attribute raw_frame.
Instance Method Summary collapse
- #events ⇒ Object
-
#initialize(raw_frame) ⇒ Frame
constructor
A new instance of Frame.
- #participant_frames ⇒ Object
- #timestamp ⇒ Object
Constructor Details
#initialize(raw_frame) ⇒ Frame
Returns a new instance of Frame.
23 24 25 |
# File 'lib/lol_api/types/dtos/timeline.rb', line 23 def initialize(raw_frame) @raw_frame = raw_frame end |
Instance Attribute Details
#raw_frame ⇒ Object (readonly)
Returns the value of attribute raw_frame.
21 22 23 |
# File 'lib/lol_api/types/dtos/timeline.rb', line 21 def raw_frame @raw_frame end |
Instance Method Details
#events ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/lol_api/types/dtos/timeline.rb', line 27 def events if events = @raw_frame['events'] events.map { |x| Event.new(x) } else [] end end |
#participant_frames ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/lol_api/types/dtos/timeline.rb', line 35 def participant_frames if frames = @raw_frame['participantFrames'] frames.map{|x| ParticipantFrame.new(x[1])} else [] end end |
#timestamp ⇒ Object
43 44 45 |
# File 'lib/lol_api/types/dtos/timeline.rb', line 43 def @raw_frame['timestamp'] end |