Class: RiotKit::Models::Riot::MatchCollection
- Inherits:
-
Object
- Object
- RiotKit::Models::Riot::MatchCollection
- Includes:
- Enumerable
- Defined in:
- lib/riot_kit/models/riot/match_collection.rb
Instance Attribute Summary collapse
-
#filter ⇒ Object
readonly
Returns the value of attribute filter.
-
#nickname ⇒ Object
readonly
Returns the value of attribute nickname.
-
#puuid ⇒ Object
readonly
Returns the value of attribute puuid.
Instance Method Summary collapse
- #each ⇒ Object
- #entries ⇒ Object
- #find_by_riot_id(match_id) ⇒ Object
-
#initialize(nickname:, filter:, puuid:, client: nil, config: RiotKit.config) ⇒ MatchCollection
constructor
A new instance of MatchCollection.
Constructor Details
#initialize(nickname:, filter:, puuid:, client: nil, config: RiotKit.config) ⇒ MatchCollection
Returns a new instance of MatchCollection.
11 12 13 14 15 16 17 |
# File 'lib/riot_kit/models/riot/match_collection.rb', line 11 def initialize(nickname:, filter:, puuid:, client: nil, config: RiotKit.config) @nickname = nickname @filter = filter @puuid = puuid @client = client @config = config end |
Instance Attribute Details
#filter ⇒ Object (readonly)
Returns the value of attribute filter.
9 10 11 |
# File 'lib/riot_kit/models/riot/match_collection.rb', line 9 def filter @filter end |
#nickname ⇒ Object (readonly)
Returns the value of attribute nickname.
9 10 11 |
# File 'lib/riot_kit/models/riot/match_collection.rb', line 9 def nickname @nickname end |
#puuid ⇒ Object (readonly)
Returns the value of attribute puuid.
9 10 11 |
# File 'lib/riot_kit/models/riot/match_collection.rb', line 9 def puuid @puuid end |
Instance Method Details
#each ⇒ Object
19 20 21 |
# File 'lib/riot_kit/models/riot/match_collection.rb', line 19 def each(&) entries.each(&) end |
#entries ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/riot_kit/models/riot/match_collection.rb', line 23 def entries ::RiotKit::Services::Riot::MatchHistory.call( nickname: nickname, filter: filter, puuid: puuid, client: @client, config: @config ).value! end |
#find_by_riot_id(match_id) ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/riot_kit/models/riot/match_collection.rb', line 33 def find_by_riot_id(match_id) ::RiotKit::Services::Riot::MatchDetail.call( match_id: match_id, puuid: puuid, client: @client, config: @config ).value! end |