ruby-lol 0.12.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. checksums.yaml +4 -4
  2. data/.editorconfig +16 -0
  3. data/.gitignore +2 -0
  4. data/.rspec +1 -0
  5. data/.rubocop.yml +1157 -0
  6. data/.travis.yml +1 -1
  7. data/lib/lol/champion_mastery_request.rb +29 -57
  8. data/lib/lol/champion_request.rb +19 -23
  9. data/lib/lol/client.rb +16 -21
  10. data/lib/lol/dynamic_model.rb +14 -5
  11. data/lib/lol/featured_game_list.rb +15 -0
  12. data/lib/lol/league_request.rb +28 -49
  13. data/lib/lol/lol_status_request.rb +9 -26
  14. data/lib/lol/masteries_request.rb +14 -0
  15. data/lib/lol/match_request.rb +51 -9
  16. data/lib/lol/request.rb +55 -21
  17. data/lib/lol/runes_request.rb +14 -0
  18. data/lib/lol/spectator_request.rb +24 -0
  19. data/lib/lol/static_request.rb +34 -23
  20. data/lib/lol/summoner_request.rb +22 -51
  21. data/lib/lol/tournament_request.rb +95 -0
  22. data/lib/lol/version.rb +1 -1
  23. data/ruby-lol.gemspec +1 -1
  24. data/spec/api_version_spec.rb +10 -9
  25. data/spec/fixtures/{v1.2 → v3}/get-champion-266.json +0 -0
  26. data/spec/fixtures/{v1.2/get-champion.json → v3/get-champion-all.json} +0 -0
  27. data/spec/fixtures/{v1.0/get-champion-mastery-champions.json → v3/get-champion-masteries.json} +0 -0
  28. data/spec/fixtures/{v1.0/get-champion-mastery-champion.json → v3/get-champion-mastery.json} +0 -0
  29. data/spec/fixtures/v3/get-current-game.json +1 -0
  30. data/spec/fixtures/v3/get-featured-games.json +1 -0
  31. data/spec/fixtures/v3/get-ids-by-tc.json +1 -0
  32. data/spec/fixtures/v3/get-league-challenger.json +1 -0
  33. data/spec/fixtures/v3/get-league-master.json +1 -0
  34. data/spec/fixtures/v3/get-league-positions.json +1 -0
  35. data/spec/fixtures/v3/get-league-summoner.json +1 -0
  36. data/spec/fixtures/v3/get-lol-status-shard.json +1 -0
  37. data/spec/fixtures/v3/get-masteries.json +1 -0
  38. data/spec/fixtures/v3/get-match-with-tc.json +1 -0
  39. data/spec/fixtures/v3/get-match.json +1 -0
  40. data/spec/fixtures/v3/get-matches-recent.json +1 -0
  41. data/spec/fixtures/v3/get-matches.json +1 -0
  42. data/spec/fixtures/v3/get-runes.json +1 -0
  43. data/spec/fixtures/v3/get-static-champions-by-id.json +1 -0
  44. data/spec/fixtures/v3/get-static-champions.json +1 -0
  45. data/spec/fixtures/v3/get-static-items-by-id.json +1 -0
  46. data/spec/fixtures/v3/get-static-items.json +1 -0
  47. data/spec/fixtures/v3/get-static-maps.json +1 -0
  48. data/spec/fixtures/v3/get-static-masteries-by-id.json +1 -0
  49. data/spec/fixtures/v3/get-static-masteries.json +1 -0
  50. data/spec/fixtures/v3/get-static-realms.json +1 -0
  51. data/spec/fixtures/v3/get-static-runes-by-id.json +1 -0
  52. data/spec/fixtures/v3/get-static-runes.json +1 -0
  53. data/spec/fixtures/v3/get-static-summoner-spells-by-id.json +1 -0
  54. data/spec/fixtures/v3/get-static-summoner-spells.json +1 -0
  55. data/spec/fixtures/v3/get-static-versions.json +1 -0
  56. data/spec/fixtures/v3/get-summoner-by-name.json +1 -0
  57. data/spec/fixtures/v3/get-summoner.json +1 -0
  58. data/spec/fixtures/v3/get-timeline.json +1 -0
  59. data/spec/fixtures/v3/get-tournament-code.json +1 -0
  60. data/spec/lol/champion_mastery_request_spec.rb +33 -133
  61. data/spec/lol/champion_request_spec.rb +17 -30
  62. data/spec/lol/client_spec.rb +12 -56
  63. data/spec/lol/league_request_spec.rb +29 -72
  64. data/spec/lol/lol_status_request_spec.rb +6 -34
  65. data/spec/lol/masteries_request_spec.rb +15 -0
  66. data/spec/lol/match_request_spec.rb +45 -10
  67. data/spec/lol/request_spec.rb +5 -5
  68. data/spec/lol/runes_request_spec.rb +15 -0
  69. data/spec/lol/spectator_request_spec.rb +23 -0
  70. data/spec/lol/static_request_spec.rb +44 -48
  71. data/spec/lol/summoner_request_spec.rb +20 -71
  72. data/spec/lol/tournament_request_spec.rb +36 -0
  73. metadata +92 -175
  74. data/lib/lol/champion.rb +0 -37
  75. data/lib/lol/champion_mastery.rb +0 -50
  76. data/lib/lol/champion_statistics_summary.rb +0 -25
  77. data/lib/lol/current_game_request.rb +0 -16
  78. data/lib/lol/featured_games_request.rb +0 -15
  79. data/lib/lol/game.rb +0 -85
  80. data/lib/lol/game_request.rb +0 -19
  81. data/lib/lol/league.rb +0 -32
  82. data/lib/lol/league_entry.rb +0 -74
  83. data/lib/lol/mastery.rb +0 -16
  84. data/lib/lol/mastery_page.rb +0 -28
  85. data/lib/lol/match_list_request.rb +0 -15
  86. data/lib/lol/match_summary.rb +0 -59
  87. data/lib/lol/mini_series.rb +0 -29
  88. data/lib/lol/model.rb +0 -28
  89. data/lib/lol/player.rb +0 -21
  90. data/lib/lol/player_statistic.rb +0 -46
  91. data/lib/lol/ranked_statistics_summary.rb +0 -35
  92. data/lib/lol/roster.rb +0 -23
  93. data/lib/lol/rune_page.rb +0 -28
  94. data/lib/lol/rune_slot.rb +0 -29
  95. data/lib/lol/stats_request.rb +0 -35
  96. data/lib/lol/summoner.rb +0 -36
  97. data/lib/lol/team.rb +0 -110
  98. data/lib/lol/team_member.rb +0 -33
  99. data/lib/lol/team_request.rb +0 -32
  100. data/lib/lol/team_statistic.rb +0 -53
  101. data/lib/lol/tournament_code.rb +0 -58
  102. data/lib/lol/tournament_provider_request.rb +0 -111
  103. data/spec/fixtures/v1.0/get-champion-mastery-top-champions-10.json +0 -121
  104. data/spec/fixtures/v1.0/get-champion-mastery-top-champions.json +0 -38
  105. data/spec/fixtures/v1.0/get-current-game.json +0 -1065
  106. data/spec/fixtures/v1.0/get-featured-games.json +0 -730
  107. data/spec/fixtures/v1.0/get-lol-status-shard-by-region.json +0 -39
  108. data/spec/fixtures/v1.0/get-lol-status-shards.json +0 -78
  109. data/spec/fixtures/v1.2/get-champion-by-id.json +0 -6
  110. data/spec/fixtures/v1.2/get-item-by-id.json +0 -6
  111. data/spec/fixtures/v1.2/get-item.json +0 -1563
  112. data/spec/fixtures/v1.2/get-mastery-by-id.json +0 -9
  113. data/spec/fixtures/v1.2/get-mastery.json +0 -389
  114. data/spec/fixtures/v1.2/get-realm.json +0 -1
  115. data/spec/fixtures/v1.2/get-rune-by-id.json +0 -26
  116. data/spec/fixtures/v1.2/get-rune.json +0 -2966
  117. data/spec/fixtures/v1.2/get-static-champion.json +0 -714
  118. data/spec/fixtures/v1.2/get-summoner-spell-by-id.json +0 -39
  119. data/spec/fixtures/v1.2/get-summoner-spell.json +0 -97
  120. data/spec/fixtures/v1.2/get-versions.json +0 -1
  121. data/spec/fixtures/v1.3/get-game.json +0 -1040
  122. data/spec/fixtures/v1.3/get-ranked_stats.json +0 -1
  123. data/spec/fixtures/v1.3/get-stats.json +0 -1
  124. data/spec/fixtures/v1.4/get-summoner-by-name.json +0 -1
  125. data/spec/fixtures/v1.4/get-summoner-masteries.json +0 -898
  126. data/spec/fixtures/v1.4/get-summoner-name.json +0 -1
  127. data/spec/fixtures/v1.4/get-summoner-runes.json +0 -2547
  128. data/spec/fixtures/v1.4/get-summoner.json +0 -1
  129. data/spec/fixtures/v2.2/get-match.json +0 -1
  130. data/spec/fixtures/v2.2/get-match_list.json +0 -1
  131. data/spec/fixtures/v2.4/get-by-summoner.json +0 -1
  132. data/spec/fixtures/v2.4/get-team.json +0 -1
  133. data/spec/fixtures/v2.5/get-league-by-team.json +0 -1
  134. data/spec/fixtures/v2.5/get-league-challenger.json +0 -1
  135. data/spec/fixtures/v2.5/get-league-entry-by-team.json +0 -1
  136. data/spec/fixtures/v2.5/get-league-entry.json +0 -1
  137. data/spec/fixtures/v2.5/get-league-master.json +0 -1
  138. data/spec/fixtures/v2.5/get-league.json +0 -1
  139. data/spec/lol/champion_mastery_spec.rb +0 -20
  140. data/spec/lol/champion_spec.rb +0 -19
  141. data/spec/lol/champion_statistics_summary_spec.rb +0 -38
  142. data/spec/lol/current_game_request_spec.rb +0 -47
  143. data/spec/lol/featured_games_request_spec.rb +0 -39
  144. data/spec/lol/game_request_spec.rb +0 -32
  145. data/spec/lol/game_spec.rb +0 -51
  146. data/spec/lol/league_entry_spec.rb +0 -51
  147. data/spec/lol/league_spec.rb +0 -31
  148. data/spec/lol/mastery_page_spec.rb +0 -29
  149. data/spec/lol/mastery_spec.rb +0 -17
  150. data/spec/lol/match_list_request_spec.rb +0 -39
  151. data/spec/lol/match_summary_spec.rb +0 -25
  152. data/spec/lol/mini_series_spec.rb +0 -25
  153. data/spec/lol/model_spec.rb +0 -13
  154. data/spec/lol/player_spec.rb +0 -19
  155. data/spec/lol/player_statistic_spec.rb +0 -44
  156. data/spec/lol/ranked_statistics_summary_spec.rb +0 -32
  157. data/spec/lol/roster_spec.rb +0 -24
  158. data/spec/lol/rune_page_spec.rb +0 -28
  159. data/spec/lol/rune_slot_spec.rb +0 -16
  160. data/spec/lol/stats_request_spec.rb +0 -93
  161. data/spec/lol/summoner_spec.rb +0 -20
  162. data/spec/lol/team_member_spec.rb +0 -27
  163. data/spec/lol/team_request_spec.rb +0 -47
  164. data/spec/lol/team_spec.rb +0 -54
  165. data/spec/lol/team_statistic_spec.rb +0 -20
  166. data/spec/lol/tournament_code_spec.rb +0 -20
  167. data/spec/lol/tournament_provider_request_spec.rb +0 -73
@@ -1,37 +0,0 @@
1
- module Lol
2
- class Champion < Lol::Model
3
- # @!attribute [r] id
4
- # @return [Fixnum] id of Champion
5
- attr_reader :id
6
-
7
- # @!attribute [r] active
8
- # @return [true] if the Champion is active
9
- # @return [false] if the Champion is disabled
10
- attr_reader :active
11
-
12
- # @!attribute [r] bot_enabled
13
- # @return [true] if the Champion is enabled in custom bot games
14
- # @return [false] if the Champion is disabled in custom bot games
15
- attr_reader :bot_enabled
16
-
17
- # @!attribute [r] free_to_play
18
- # @return [true] if the Champion is currently free to play
19
- # @return [false] if the Champion isn't currently free to play
20
- attr_reader :free_to_play
21
-
22
- # @!attribute [r] bot_mm_enabled
23
- # @return [true] if the Champion is enabled in match made bot games
24
- # @return [false] if the Champion is disabled in match made bot games
25
- attr_reader :bot_mm_enabled
26
-
27
- # @!attribute [r] ranked_play_enabled
28
- # @return [true] if the Champion is enabled in ranked play
29
- # @return [false] if the Champion is disabled in ranked play
30
- attr_reader :ranked_play_enabled
31
-
32
- private
33
-
34
- attr_writer :id, :active, :bot_enabled, :free_to_play, :bot_mm_enabled,
35
- :ranked_play_enabled
36
- end
37
- end
@@ -1,50 +0,0 @@
1
- module Lol
2
- class ChampionMastery < Lol::Model
3
- # @!attribute [r] champion_id
4
- # @return [Fixnum] id of Champion
5
- attr_reader :champion_id
6
-
7
- # @!attribute [r] champion_level
8
- # @return [Fixnum] Level of mastery for this champion
9
- attr_reader :champion_level
10
-
11
- # @!attribute [r] champion_points
12
- # @return [Fixnum] Number of mastery points for this champion
13
- attr_reader :champion_points
14
-
15
- # @!attribute [r] champion_points_since_last_level
16
- # @return [Fixnum] Number of mastery points since the last level for this champion
17
- attr_reader :champion_points_since_last_level
18
-
19
- # @!attribute [r] champion_points_until_next_level
20
- # @return [Fixnum] Number of mastery points until the next level for this champion
21
- attr_reader :champion_points_until_next_level
22
-
23
- # @!attribute [r] chest_granted
24
- # @return [true] if the chest for this champion has been granted
25
- # @return [false] if the chest for this champion has been granted or not in current season
26
- attr_reader :chest_granted
27
-
28
- # @!attribute [r] highest_grade
29
- # @return [String] The highest grade of this champion of current season
30
- attr_reader :highest_grade
31
-
32
- # @!attribute [r] last_play_time
33
- # @return [Fixnum] Last time this champion was played by this player - in Unix milliseconds time format
34
- attr_reader :last_play_time
35
-
36
- # @!attribute [r] player_id
37
- # @return [Fixnum] Player ID for this entry
38
- attr_reader :player_id
39
-
40
- # @!attribute [r] player_id
41
- # @return [Fixnum] Number of tokens earned
42
- attr_reader :tokens_earned
43
-
44
- private
45
-
46
- attr_writer :champion_id, :champion_level, :champion_points, :champion_points_since_last_level,
47
- :champion_points_until_next_level, :chest_granted, :highest_grade, :last_play_time, :player_id,
48
- :tokens_earned
49
- end
50
- end
@@ -1,25 +0,0 @@
1
- require 'lol/model'
2
-
3
- module Lol
4
- class ChampionStatisticsSummary < Lol::Model
5
- # @!attribute [r] id
6
- # @return [Fixnum] Champion Id
7
- attr_reader :id
8
-
9
- # @!attribute [r] name
10
- # @return [String] Champion Name
11
- attr_reader :name
12
-
13
- # @!attribute [r] stats
14
- # @return [Array] List of stats associated with this champion
15
- attr_reader :stats
16
-
17
- private
18
-
19
- attr_writer :id, :name
20
-
21
- def stats= value
22
- @stats = value.is_a?(Hash) && OpenStruct.new(Lol.underscore_hash_keys value) || value
23
- end
24
- end
25
- end
@@ -1,16 +0,0 @@
1
- module Lol
2
- class CurrentGameRequest < Request
3
- def self.api_version
4
- 'v1.0'
5
- end
6
-
7
- def api_url path, params = {}
8
- "#{api_base_url}/observer-mode/rest/consumer/#{path}?#{api_query_string params}"
9
- end
10
-
11
- def spectator_game_info platform_id, summoner_id
12
- url = api_url "getSpectatorGameInfo/#{platform_id}/#{summoner_id}"
13
- DynamicModel.new perform_request(url)
14
- end
15
- end
16
- end
@@ -1,15 +0,0 @@
1
- module Lol
2
- class FeaturedGamesRequest < Request
3
- def self.api_version
4
- "v1.0"
5
- end
6
-
7
- def api_url path, params = {}
8
- "#{api_base_url}/observer-mode/rest/#{path}?#{api_query_string params}"
9
- end
10
-
11
- def get
12
- DynamicModel.new perform_request api_url "featured"
13
- end
14
- end
15
- end
@@ -1,85 +0,0 @@
1
- require 'lol/model'
2
-
3
- module Lol
4
- class Game < Lol::Model
5
- # @!attribute [r] champion_id
6
- # @return [Fixnum] Champion Id associated with this game
7
- attr_reader :champion_id
8
-
9
- # @!attribute [r] create_date
10
- # @return [Time] Date game was played
11
- attr_reader :create_date
12
-
13
- # @!attribute [r] fellow_players
14
- # @return [Array] list of players associated with this game
15
- attr_reader :fellow_players
16
-
17
- # @!attribute [r] id
18
- # @return [Fixnum] Game Id
19
- attr_reader :game_id
20
-
21
- # @!attribute [r] game_mode
22
- # @return [String] Game Mode
23
- attr_reader :game_mode
24
-
25
- # @!attribute [r] game_type
26
- # @return [String] Game Type
27
- attr_reader :game_type
28
-
29
- # @!attribute [r] invalid
30
- # @return [true] if the game is invalid
31
- # @return [false] if the game is valid
32
- attr_reader :invalid
33
-
34
- # @!attribute [r] ip_earned
35
- # @return [Fixnum] IP Earned
36
- attr_reader :ip_earned
37
-
38
- # @!attribute [r] level
39
- # @return [Fixnum] Level
40
- attr_reader :level
41
-
42
- # @!attribute [r] map_id
43
- # @return [Fixnum] Map Id
44
- attr_reader :map_id
45
-
46
- # @!attribute [r] spell1
47
- # @return [Fixnum] Summoner first spell id
48
- attr_reader :spell1
49
-
50
- # @!attribute [r] spell2
51
- # @return [Fixnum] Summoner second spell id
52
- attr_reader :spell2
53
-
54
- # @!attribute [r] statistics
55
- # @return [Array] Statistics associated with the game for this summoner
56
- attr_reader :stats
57
-
58
- # @!attribute [r] sub_type
59
- # @return [String] Game sub-type
60
- attr_reader :sub_type
61
-
62
- # @!attribute [r] team_id
63
- # @return [Fixnum] Team Id associated with game
64
- attr_reader :team_id
65
-
66
- private
67
-
68
- attr_writer :champion_id, :game_id, :game_mode, :game_type, :invalid, :ip_earned,
69
- :level, :map_id, :spell1, :spell2, :sub_type, :team_id
70
-
71
- def create_date= value
72
- @create_date = value.is_a?(Numeric) && Time.at(value / 1000) || value
73
- end
74
-
75
- def fellow_players= collection
76
- @fellow_players = collection.map do |c|
77
- c.respond_to?(:[]) && Player.new(c) || c
78
- end
79
- end
80
-
81
- def stats= value
82
- @stats = value.is_a?(Hash) && OpenStruct.new(Lol.underscore_hash_keys value) || value
83
- end
84
- end
85
- end
@@ -1,19 +0,0 @@
1
- module Lol
2
- class GameRequest < Request
3
- # Returns the supported API Version
4
- # @return [String] the supported api version
5
- def self.api_version
6
- ENV['EXPERIMENTAL'] ? "v2.2" : "v1.3"
7
- end
8
-
9
- # Returns a list of the recent games played by a summoner
10
- # @param summoner_id [Fixnum] Summoner id
11
- # @return [Array] an array of games
12
- def recent summoner_id
13
- summoner_api_path = "game/by-summoner/#{summoner_id}/recent"
14
- perform_request(api_url(summoner_api_path))["games"].map do |game_data|
15
- Game.new game_data
16
- end
17
- end
18
- end
19
- end
@@ -1,32 +0,0 @@
1
- module Lol
2
- # Holds the representation of a League
3
- class League < Model
4
- # @!attribute [r] name
5
- # @return [String] name of league
6
- attr_reader :name
7
-
8
- # @!attribute [r] tier
9
- # @return [String] tier of league
10
- attr_reader :tier
11
-
12
- # @!attribute [r] queue
13
- # @return [String] type of queue
14
- attr_reader :queue
15
-
16
- # @!attribute [r] entries
17
- # @return [String] summoners / teams in queue
18
- attr_reader :entries
19
-
20
- # @!attribute [r] participant_id
21
- # @return [String] summoner id of league participant
22
- attr_reader :participant_id
23
-
24
- private
25
-
26
- attr_writer :timestamp, :name, :tier, :queue, :participant_id
27
-
28
- def entries=(entries)
29
- @entries = entries.map(&LeagueEntry.method(:new))
30
- end
31
- end
32
- end
@@ -1,74 +0,0 @@
1
- module Lol
2
- # Holds the representation of a League
3
- class LeagueEntry < Model
4
- # @!attribute [r] division
5
- # @return [String] the league division of the participant
6
- attr_reader :division
7
-
8
- # @!attribute [r] is_fresh_blood
9
- # @return [Boolean] is fresh blood in this league
10
- attr_reader :is_fresh_blood
11
-
12
- # @!attribute [r] is_hot_streak
13
- # @return [Boolean] is currently on hot streak
14
- attr_reader :is_hot_streak
15
-
16
- # @!attribute [r] is_inactive
17
- # @return [Boolean] is marked as inactive
18
- attr_reader :is_inactive
19
-
20
- # @!attribute [r] is_veteran
21
- # @return [Boolean] is a veteran in this league
22
- attr_reader :is_veteran
23
-
24
- # @!attribute [r] league_points
25
- # @return [String] league points of entry
26
- attr_reader :league_points
27
-
28
- # @!attribute [r] mini_series
29
- # @return [MiniSeries] if player is in a mini_series, returns the MiniSeries object
30
- # representing it
31
- attr_reader :mini_series
32
-
33
- # @!attribute [r] player_or_team_id
34
- # @return [String] id for the player or the team returned
35
- attr_reader :player_or_team_id
36
-
37
- # @!attribute [r] player_or_team_name
38
- # @return [String] name for the player or the team returned
39
- attr_reader :player_or_team_name
40
-
41
- # @!attribute [r] wins
42
- # @return [String] wins
43
- attr_reader :wins
44
-
45
- # @!attribute [r] losses
46
- # @return [String] losses
47
- attr_reader :losses
48
-
49
- # @!attribute [r] last_played
50
- # @return [DateTime] date of last played game
51
- # at the time of writing this attributes is broken in the API
52
- # it always returns 0.
53
- attr_reader :last_played
54
-
55
- # @!attribute [r] time_until_decay
56
- # @return [Boolean] time until league decay
57
- attr_reader :time_until_decay
58
-
59
- # @!attribute [r] playstyle
60
- # @return [String] participant playstyle (NONE, SOLO, SQUAD, TEAM)
61
- attr_reader :playstyle
62
-
63
- private
64
-
65
- attr_writer :player_or_team_id, :player_or_team_name, :division, :league_points, :wins,
66
- :is_hot_streak, :is_veteran, :is_fresh_blood, :playstyle,
67
- :is_inactive, :time_until_decay, :last_played, :losses
68
-
69
- def mini_series= raw
70
- @mini_series = MiniSeries.new raw
71
- end
72
-
73
- end
74
- end
@@ -1,16 +0,0 @@
1
- module Lol
2
- class Mastery < Model
3
-
4
- # @!attribute [r] id
5
- # @return [Fixnum] id of talent
6
- attr_reader :id
7
-
8
- # @!attribute [r] rank
9
- # @return [Fixnum] rank of talent
10
- attr_reader :rank
11
-
12
- private
13
-
14
- attr_writer :id, :rank
15
- end
16
- end
@@ -1,28 +0,0 @@
1
- module Lol
2
- class MasteryPage < Model
3
-
4
- # @!attribute [r] id
5
- # @return [Fixnum] mastery page id
6
- attr_reader :id
7
-
8
- # @!attribute [r] masteries
9
- # @return [Array] array of Lol::Mastery
10
- attr_reader :masteries
11
-
12
- # @!attribute [r] name
13
- # @return [String] name of mastery page
14
- attr_reader :name
15
-
16
- # @!attribute [r] current
17
- # @return [Boolean] is it the current mastery page?
18
- attr_reader :current
19
-
20
- private
21
-
22
- attr_writer :id, :name, :current
23
-
24
- def masteries= new_masteries
25
- @masteries = new_masteries.map {|t| Mastery.new t}
26
- end
27
- end
28
- end
@@ -1,15 +0,0 @@
1
- module Lol
2
- class MatchListRequest < Request
3
- # Returns the supported API Version
4
- # @return [String] the supported api version
5
- def self.api_version
6
- "v2.2"
7
- end
8
-
9
- # Returns match list for a summoner
10
- # @return []
11
- def get summoner_id, params = {}
12
- perform_request(api_url("matchlist/by-summoner/#{summoner_id}", params))
13
- end
14
- end
15
- end
@@ -1,59 +0,0 @@
1
- require 'lol/model'
2
-
3
- module Lol
4
- class MatchSummary < Lol::Model
5
- # @!attribute [r] assists
6
- # @return [Fixnum] Number of assists
7
- attr_reader :assists
8
-
9
- # @!attribute [r] date
10
- # @return [Time] Match date
11
- attr_reader :date
12
-
13
- # @!attribute [r] deaths
14
- # @return [Fixnum] Number of deaths
15
- attr_reader :deaths
16
-
17
- # @!attribute [r] game_id
18
- # @return [Fixnum] Game Id
19
- attr_reader :game_id
20
-
21
- # @!attribute [r] game_mode
22
- # @return [String] Game Mode
23
- attr_reader :game_mode
24
-
25
- # @!attribute [r] invalid
26
- # @return [true] If the match is invalid
27
- # @return [false] If the match is valid
28
- attr_reader :invalid
29
-
30
- # @!attribute [r] kills
31
- # @return [Fixnum] Number of kills
32
- attr_reader :kills
33
-
34
- # @!attribute [r] map_id
35
- # @return [Fixnum] Map Id
36
- attr_reader :map_id
37
-
38
- # @!attribute [r] opposing_team_kills
39
- # @return [Fixnum] Opposing Team Kills
40
- attr_reader :opposing_team_kills
41
-
42
- # @!attribute [r] opposing_team_name
43
- # @return [String] Opposing Team Name
44
- attr_reader :opposing_team_name
45
-
46
- # @!attribute [r] win
47
- # @return [true] If the team won this match
48
- # @return [false] If the team lost this match
49
- attr_reader :win
50
-
51
- private
52
-
53
- attr_writer :assists, :deaths, :game_id, :game_mode, :invalid, :kills, :map_id, :opposing_team_kills, :opposing_team_name, :win
54
-
55
- def date= value
56
- @date = value.is_a?(Numeric) && Time.at(value / 1000) || value
57
- end
58
- end
59
- end