Class: LolesportsApi::Play

Inherits:
Object
  • Object
show all
Defined in:
lib/lolesports-api/play.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Play

Returns a new instance of Play.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/lolesports-api/play.rb', line 8

def initialize(attributes = {})
  @assists = attributes['assists']
  @champion_id = attributes['championId']
  @deaths = attributes['deaths']
  @end_level = attributes['endLevel']
  @player_id = attributes['id']
  @items = processed_items(attributes)
  @kda = attributes['kda']
  @kills = attributes['kills']
  @minions_killed = attributes['minionsKilled']
  @name = attributes['name']
  @photo_url = attributes['photoURL']
  @spell0 = attributes['spell0'].to_i
  @spell1 = attributes['spell1'].to_i
  @team_id = attributes['teamId']
  @total_gold = attributes['totalGold']

  @player = prepare_player
end

Instance Attribute Details

#assistsObject (readonly)

Returns the value of attribute assists.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def assists
  @assists
end

#champion_idObject (readonly)

Returns the value of attribute champion_id.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def champion_id
  @champion_id
end

#deathsObject (readonly)

Returns the value of attribute deaths.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def deaths
  @deaths
end

#end_levelObject (readonly)

Returns the value of attribute end_level.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def end_level
  @end_level
end

#itemsObject (readonly)

Returns the value of attribute items.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def items
  @items
end

#kdaObject (readonly)

Returns the value of attribute kda.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def kda
  @kda
end

#killsObject (readonly)

Returns the value of attribute kills.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def kills
  @kills
end

#minions_killedObject (readonly)

Returns the value of attribute minions_killed.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def minions_killed
  @minions_killed
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def name
  @name
end

#photo_urlObject (readonly)

Returns the value of attribute photo_url.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def photo_url
  @photo_url
end

#playerObject (readonly)

Returns the value of attribute player.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def player
  @player
end

#player_idObject (readonly)

Returns the value of attribute player_id.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def player_id
  @player_id
end

#spell0Object (readonly)

Returns the value of attribute spell0.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def spell0
  @spell0
end

#spell1Object (readonly)

Returns the value of attribute spell1.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def spell1
  @spell1
end

#team_idObject (readonly)

Returns the value of attribute team_id.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def team_id
  @team_id
end

#total_goldObject (readonly)

Returns the value of attribute total_gold.



3
4
5
# File 'lib/lolesports-api/play.rb', line 3

def total_gold
  @total_gold
end