Class: LolApi::Frame

Inherits:
Object
  • Object
show all
Defined in:
lib/lol_api/types/dtos/timeline.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_frameObject (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

#eventsObject



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_framesObject



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

#timestampObject



43
44
45
# File 'lib/lol_api/types/dtos/timeline.rb', line 43

def timestamp 
	@raw_frame['timestamp']
end