Class: LeagueOfLegends::DTO::Game
- Inherits:
-
Object
- Object
- LeagueOfLegends::DTO::Game
- Defined in:
- lib/league_of_legends/dto/game.rb
Instance Attribute Summary collapse
-
#champion_id ⇒ Object
readonly
Returns the value of attribute champion_id.
-
#create_date ⇒ Object
readonly
Returns the value of attribute create_date.
-
#fellow_players ⇒ Object
readonly
Returns the value of attribute fellow_players.
-
#game_id ⇒ Object
readonly
Returns the value of attribute game_id.
-
#game_mode ⇒ Object
readonly
Returns the value of attribute game_mode.
-
#game_type ⇒ Object
readonly
Returns the value of attribute game_type.
-
#invalid ⇒ Object
readonly
Returns the value of attribute invalid.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#map_id ⇒ Object
readonly
Returns the value of attribute map_id.
-
#spell_1 ⇒ Object
readonly
Returns the value of attribute spell_1.
-
#spell_2 ⇒ Object
readonly
Returns the value of attribute spell_2.
-
#stats ⇒ Object
readonly
Returns the value of attribute stats.
-
#sub_type ⇒ Object
readonly
Returns the value of attribute sub_type.
-
#team_id ⇒ Object
readonly
Returns the value of attribute team_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Game
constructor
A new instance of Game.
Constructor Details
#initialize(attributes) ⇒ Game
Returns a new instance of Game.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/league_of_legends/dto/game.rb', line 15 def initialize attributes return if attributes.nil? @champion_id = attributes[:championId].to_i @create_date = Time.at(attributes[:createDate]/1000) @fellow_players = attributes[:fellowPlayers].map do |player| ::LeagueOfLegends::DTO::Player.new(player) end @game_id = attributes[:gameId].to_i @game_mode = attributes[:gameMode] @game_type = attributes[:gameType] @invalid = attributes[:invalid] @level = attributes[:level].to_i @map_id = attributes[:mapId].to_i @spell_1 = attributes[:spell1].to_i @spell_2 = attributes[:spell2].to_i @stats = ::LeagueOfLegends::DTO::RawStats.new(attributes[:stats]) @sub_type = attributes[:subType] @team_id = attributes[:teamId].to_i end |
Instance Attribute Details
#champion_id ⇒ Object (readonly)
Returns the value of attribute champion_id.
11 12 13 |
# File 'lib/league_of_legends/dto/game.rb', line 11 def champion_id @champion_id end |
#create_date ⇒ Object (readonly)
Returns the value of attribute create_date.
11 12 13 |
# File 'lib/league_of_legends/dto/game.rb', line 11 def create_date @create_date end |
#fellow_players ⇒ Object (readonly)
Returns the value of attribute fellow_players.
11 12 13 |
# File 'lib/league_of_legends/dto/game.rb', line 11 def fellow_players @fellow_players end |
#game_id ⇒ Object (readonly)
Returns the value of attribute game_id.
11 12 13 |
# File 'lib/league_of_legends/dto/game.rb', line 11 def game_id @game_id end |
#game_mode ⇒ Object (readonly)
Returns the value of attribute game_mode.
11 12 13 |
# File 'lib/league_of_legends/dto/game.rb', line 11 def game_mode @game_mode end |
#game_type ⇒ Object (readonly)
Returns the value of attribute game_type.
11 12 13 |
# File 'lib/league_of_legends/dto/game.rb', line 11 def game_type @game_type end |
#invalid ⇒ Object (readonly)
Returns the value of attribute invalid.
11 12 13 |
# File 'lib/league_of_legends/dto/game.rb', line 11 def invalid @invalid end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
11 12 13 |
# File 'lib/league_of_legends/dto/game.rb', line 11 def level @level end |
#map_id ⇒ Object (readonly)
Returns the value of attribute map_id.
11 12 13 |
# File 'lib/league_of_legends/dto/game.rb', line 11 def map_id @map_id end |
#spell_1 ⇒ Object (readonly)
Returns the value of attribute spell_1.
11 12 13 |
# File 'lib/league_of_legends/dto/game.rb', line 11 def spell_1 @spell_1 end |
#spell_2 ⇒ Object (readonly)
Returns the value of attribute spell_2.
11 12 13 |
# File 'lib/league_of_legends/dto/game.rb', line 11 def spell_2 @spell_2 end |
#stats ⇒ Object (readonly)
Returns the value of attribute stats.
11 12 13 |
# File 'lib/league_of_legends/dto/game.rb', line 11 def stats @stats end |
#sub_type ⇒ Object (readonly)
Returns the value of attribute sub_type.
11 12 13 |
# File 'lib/league_of_legends/dto/game.rb', line 11 def sub_type @sub_type end |
#team_id ⇒ Object (readonly)
Returns the value of attribute team_id.
11 12 13 |
# File 'lib/league_of_legends/dto/game.rb', line 11 def team_id @team_id end |
Class Method Details
.version ⇒ Object
7 8 9 |
# File 'lib/league_of_legends/dto/game.rb', line 7 def self.version ::LeagueOfLegends::DTO::RecentGames.version end |