Class: RiotKit::Models::Riot::MatchEntry
- Inherits:
-
Object
- Object
- RiotKit::Models::Riot::MatchEntry
- Defined in:
- lib/riot_kit/models/riot/match_entry.rb
Instance Attribute Summary collapse
-
#assists ⇒ Object
readonly
Returns the value of attribute assists.
-
#champion_id ⇒ Object
readonly
Returns the value of attribute champion_id.
-
#champion_name ⇒ Object
readonly
Returns the value of attribute champion_name.
-
#cs_per_minute ⇒ Object
readonly
Returns the value of attribute cs_per_minute.
-
#cs_total ⇒ Object
readonly
Returns the value of attribute cs_total.
-
#deaths ⇒ Object
readonly
Returns the value of attribute deaths.
-
#game_creation ⇒ Object
readonly
Returns the value of attribute game_creation.
-
#game_duration_seconds ⇒ Object
readonly
Returns the value of attribute game_duration_seconds.
-
#item_ids ⇒ Object
readonly
Returns the value of attribute item_ids.
-
#kills ⇒ Object
readonly
Returns the value of attribute kills.
-
#match_id ⇒ Object
readonly
Returns the value of attribute match_id.
-
#participant_summaries ⇒ Object
readonly
Returns the value of attribute participant_summaries.
-
#puuid ⇒ Object
readonly
Returns the value of attribute puuid.
-
#queue_id ⇒ Object
readonly
Returns the value of attribute queue_id.
-
#queue_label ⇒ Object
readonly
Returns the value of attribute queue_label.
-
#summoner_spell_ids ⇒ Object
readonly
Returns the value of attribute summoner_spell_ids.
-
#win ⇒ Object
readonly
Returns the value of attribute win.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #details(client: nil, config: RiotKit.config) ⇒ Object
-
#initialize(match_id:, queue_id:, game_creation:, champion_id:, win:, kills:, deaths:, assists:, cs_total:, cs_per_minute:, game_duration_seconds:, queue_label:, summoner_spell_ids:, item_ids:, participant_summaries:, champion_name: nil, puuid: nil) ⇒ MatchEntry
constructor
A new instance of MatchEntry.
- #to_h ⇒ Object (also: #to_cache_hash)
Constructor Details
#initialize(match_id:, queue_id:, game_creation:, champion_id:, win:, kills:, deaths:, assists:, cs_total:, cs_per_minute:, game_duration_seconds:, queue_label:, summoner_spell_ids:, item_ids:, participant_summaries:, champion_name: nil, puuid: nil) ⇒ MatchEntry
Returns a new instance of MatchEntry.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 12 def initialize(match_id:, queue_id:, game_creation:, champion_id:, win:, kills:, deaths:, assists:, cs_total:, cs_per_minute:, game_duration_seconds:, queue_label:, summoner_spell_ids:, item_ids:, participant_summaries:, champion_name: nil, puuid: nil) @match_id = match_id @queue_id = queue_id @game_creation = game_creation @champion_id = champion_id @champion_name = champion_name @win = win @kills = kills @deaths = deaths @assists = assists @cs_total = cs_total @cs_per_minute = cs_per_minute @game_duration_seconds = game_duration_seconds @queue_label = queue_label @summoner_spell_ids = summoner_spell_ids @item_ids = item_ids @participant_summaries = participant_summaries @puuid = puuid end |
Instance Attribute Details
#assists ⇒ Object (readonly)
Returns the value of attribute assists.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def assists @assists end |
#champion_id ⇒ Object (readonly)
Returns the value of attribute champion_id.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def champion_id @champion_id end |
#champion_name ⇒ Object (readonly)
Returns the value of attribute champion_name.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def champion_name @champion_name end |
#cs_per_minute ⇒ Object (readonly)
Returns the value of attribute cs_per_minute.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def cs_per_minute @cs_per_minute end |
#cs_total ⇒ Object (readonly)
Returns the value of attribute cs_total.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def cs_total @cs_total end |
#deaths ⇒ Object (readonly)
Returns the value of attribute deaths.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def deaths @deaths end |
#game_creation ⇒ Object (readonly)
Returns the value of attribute game_creation.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def game_creation @game_creation end |
#game_duration_seconds ⇒ Object (readonly)
Returns the value of attribute game_duration_seconds.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def game_duration_seconds @game_duration_seconds end |
#item_ids ⇒ Object (readonly)
Returns the value of attribute item_ids.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def item_ids @item_ids end |
#kills ⇒ Object (readonly)
Returns the value of attribute kills.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def kills @kills end |
#match_id ⇒ Object (readonly)
Returns the value of attribute match_id.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def match_id @match_id end |
#participant_summaries ⇒ Object (readonly)
Returns the value of attribute participant_summaries.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def participant_summaries @participant_summaries end |
#puuid ⇒ Object (readonly)
Returns the value of attribute puuid.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def puuid @puuid end |
#queue_id ⇒ Object (readonly)
Returns the value of attribute queue_id.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def queue_id @queue_id end |
#queue_label ⇒ Object (readonly)
Returns the value of attribute queue_label.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def queue_label @queue_label end |
#summoner_spell_ids ⇒ Object (readonly)
Returns the value of attribute summoner_spell_ids.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def summoner_spell_ids @summoner_spell_ids end |
#win ⇒ Object (readonly)
Returns the value of attribute win.
7 8 9 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 7 def win @win end |
Instance Method Details
#==(other) ⇒ Object
33 34 35 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 33 def ==(other) other.is_a?(self.class) && match_id == other.match_id end |
#details(client: nil, config: RiotKit.config) ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 61 def details(client: nil, config: RiotKit.config) return nil if puuid.to_s.strip.empty? || match_id.to_s.strip.empty? ::RiotKit::Services::Riot::MatchDetail.call( match_id: match_id, puuid: puuid, client: client, config: config ).value! rescue ::RiotKit::Errors::MatchNotFound nil end |
#to_h ⇒ Object Also known as: to_cache_hash
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/riot_kit/models/riot/match_entry.rb', line 37 def to_h { match_id: match_id, queue_id: queue_id, game_creation: game_creation, champion_id: champion_id, champion_name: champion_name, win: win, kills: kills, deaths: deaths, assists: assists, cs_total: cs_total, cs_per_minute: cs_per_minute, game_duration_seconds: game_duration_seconds, queue_label: queue_label, summoner_spell_ids: summoner_spell_ids, item_ids: item_ids, participant_summaries: participant_summaries, puuid: puuid } end |