Class: RiotKit::Models::Riot::MatchCollection

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/riot_kit/models/riot/match_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#filterObject (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

#nicknameObject (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

#puuidObject (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

#eachObject



19
20
21
# File 'lib/riot_kit/models/riot/match_collection.rb', line 19

def each(&)
  entries.each(&)
end

#entriesObject



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