league_of_legends 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4e79fae4fe5d15a9156e647c7baa01139f6cade3
4
- data.tar.gz: f44d28c489dd3c209a6f373e1bfba91564ac3cbc
3
+ metadata.gz: d3c9a8a82af10c76876be359b977badf97a7202f
4
+ data.tar.gz: 62069663415c047d3b3d4e27a5e85908b3293b2a
5
5
  SHA512:
6
- metadata.gz: ff03a8eabdc3c3d8c0265d02a38fed86ff2c080e5a955ed24ba07c67cdc324c4458585a954162c04a5825896ed4ae4d9272ac8e2df4ae94f1477b6aaac90952f
7
- data.tar.gz: af9a9a67886fb408e6976f8508c057944392c0f04c22bada2aa7520571cd2f17ceca4653336165f711b288a7521570ff18b81461a04212a51e2824bcea0cbfc6
6
+ metadata.gz: 45df8761f8e699854c0d700af46b836f5699ad8151fb07b788bb1c9596a5409bded754679c08b1b80d605eaa8dc2ed9c38faa3a2ce3a87b79e09f0e10a3009e5
7
+ data.tar.gz: 8f895b7311ea7f2e5c9497c84a9a700c88f9b74fb308e11d6895e2f9bb70c2908cb98174342edb23b6b90d4a88424524cca5b7590744cd6eb48428c130c32675
@@ -19,6 +19,7 @@ require 'league_of_legends/dto/raw_stats'
19
19
  require 'league_of_legends/dto/recent_games'
20
20
  require 'league_of_legends/dto/roster'
21
21
  require 'league_of_legends/dto/team'
22
+ require 'league_of_legends/dto/team_map'
22
23
  require 'league_of_legends/dto/team_member_info'
23
24
  require 'league_of_legends/dto/team_stat_detail'
24
25
  require 'league_of_legends/dto/team_stat_summary'
@@ -6,31 +6,33 @@ module ::LeagueOfLegends
6
6
  ::LeagueOfLegends::DTO::PlayerStatsSummaryList.version
7
7
  end
8
8
 
9
- attr_reader :average_assists, :average_champions_killed,
10
- :average_combat_player_score, :average_node_capture,
11
- :average_node_capture_assist, :average_node_neutralize,
12
- :average_node_neutralize_assist, :average_num_deaths,
13
- :average_objective_player_score, :average_team_objective,
14
- :average_total_player_score, :bot_games_layed, :killing_spree,
15
- :max_assists, :max_champions_killed, :max_combat_player_score,
16
- :max_largest_critical_strike, :max_largest_killing_spree,
17
- :max_node_capture, :max_node_capture_assist, :max_node_neutralize,
18
- :max_node_neutralize_assist, :max_num_deaths,
19
- :max_objective_player_score, :max_team_objective, :max_time_played,
20
- :max_time_spent_living, :max_total_player_score,
21
- :most_champion_kills_per_session, :most_spells_cast,
22
- :normal_games_played, :ranked_premade_games_played,
23
- :ranked_solo_games_played, :total_assists, :total_champion_kills,
24
- :total_damage_dealt, :total_damage_taken, :total_deaths_per_session,
25
- :total_double_kills, :total_first_blood, :total_gold_earned,
26
- :total_heal, :total_magic_damage_dealt, :total_minion_kills,
27
- :total_neutral_minions_killed, :total_node_capture,
28
- :total_node_neutralize, :total_penta_kills, :total_physical_damage_dealt,
29
- :total_quadra_kills, :total_sessions_lost, :total_sessions_played,
30
- :total_sessions_won, :total_triple_kills, :total_turrets_killed,
9
+ attr_reader :average_assists, :average_champions_killed,
10
+ :average_combat_player_score, :average_node_capture,
11
+ :average_node_capture_assist, :average_node_neutralize,
12
+ :average_node_neutralize_assist, :average_num_deaths,
13
+ :average_objective_player_score, :average_team_objective,
14
+ :average_total_player_score, :bot_games_layed, :killing_spree,
15
+ :max_assists, :max_champions_killed, :max_combat_player_score,
16
+ :max_largest_critical_strike, :max_largest_killing_spree,
17
+ :max_node_capture, :max_node_capture_assist, :max_node_neutralize,
18
+ :max_node_neutralize_assist, :max_num_deaths,
19
+ :max_objective_player_score, :max_team_objective, :max_time_played,
20
+ :max_time_spent_living, :max_total_player_score,
21
+ :most_champion_kills_per_session, :most_spells_cast,
22
+ :normal_games_played, :ranked_premade_games_played,
23
+ :ranked_solo_games_played, :total_assists, :total_champion_kills,
24
+ :total_damage_dealt, :total_damage_taken, :total_deaths_per_session,
25
+ :total_double_kills, :total_first_blood, :total_gold_earned,
26
+ :total_heal, :total_magic_damage_dealt, :total_minion_kills,
27
+ :total_neutral_minions_killed, :total_node_capture,
28
+ :total_node_neutralize, :total_penta_kills, :total_physical_damage_dealt,
29
+ :total_quadra_kills, :total_sessions_lost, :total_sessions_played,
30
+ :total_sessions_won, :total_triple_kills, :total_turrets_killed,
31
31
  :total_unreal_kills
32
32
 
33
33
  def initialize attributes
34
+ return if attributes.nil?
35
+
34
36
  @average_assists = attributes[:averageAssists].to_i
35
37
  @average_champions_killed = attributes[:averageChampionsKilled].to_i
36
38
  @average_combat_player_score = attributes[:averageCombatPlayerScore].to_i
@@ -91,4 +93,4 @@ module ::LeagueOfLegends
91
93
 
92
94
  end
93
95
  end
94
- end
96
+ end
@@ -12,6 +12,8 @@ module ::LeagueOfLegends
12
12
  :ranked_play_enabled
13
13
 
14
14
  def initialize attributes
15
+ return if attributes.nil?
16
+
15
17
  @active = attributes[:active]
16
18
  @attack_rank = attributes[:attackRank]
17
19
  @bot_enabled = attributes[:botEnabled]
@@ -27,4 +29,4 @@ module ::LeagueOfLegends
27
29
 
28
30
  end
29
31
  end
30
- end
32
+ end
@@ -11,6 +11,8 @@ module ::LeagueOfLegends
11
11
  attr_reader :id, :name, :stats
12
12
 
13
13
  def initialize attributes
14
+ return if attributes.nil?
15
+
14
16
  @id = attributes[:id].to_i
15
17
  @name = attributes[:name]
16
18
  @stats = ::LeagueOfLegends::DTO::AggregatedStats.new(attributes[:stats])
@@ -18,4 +20,4 @@ module ::LeagueOfLegends
18
20
 
19
21
  end
20
22
  end
21
- end
23
+ end
@@ -8,11 +8,13 @@ module ::LeagueOfLegends
8
8
  ::LeagueOfLegends::DTO::RecentGames.version
9
9
  end
10
10
 
11
- attr_reader :champion_id, :create_date, :fellow_players,
12
- :game_id, :game_mode, :game_type, :invalid, :level, :map_id,
11
+ attr_reader :champion_id, :create_date, :fellow_players,
12
+ :game_id, :game_mode, :game_type, :invalid, :level, :map_id,
13
13
  :spell_1, :spell_2, :stats, :sub_type, :team_id
14
14
 
15
15
  def initialize attributes
16
+ return if attributes.nil?
17
+
16
18
  @champion_id = attributes[:championId].to_i
17
19
  @create_date = Time.at(attributes[:createDate]/1000)
18
20
  @fellow_players = attributes[:fellowPlayers].map do |player|
@@ -33,4 +35,4 @@ module ::LeagueOfLegends
33
35
 
34
36
  end
35
37
  end
36
- end
38
+ end
@@ -15,6 +15,7 @@ module ::LeagueOfLegends
15
15
  attributes = build_attributes json
16
16
  else
17
17
  attributes = json
18
+ return if attributes.nil?
18
19
  end
19
20
 
20
21
  @entries = attributes[:entries].map do |entry|
@@ -28,4 +29,4 @@ module ::LeagueOfLegends
28
29
 
29
30
  end
30
31
  end
31
- end
32
+ end
@@ -11,6 +11,8 @@ module ::LeagueOfLegends
11
11
  attr_reader :is_fresh_blood, :is_hot_streak, :is_inactive, :is_veteran, :last_played, :league_name, :league_points, :mini_series, :player_or_team_id, :player_or_team_name, :queue_type, :rank, :tier, :wins
12
12
 
13
13
  def initialize attributes
14
+ return if attributes.nil?
15
+
14
16
  @is_fresh_blood = attributes[:isFreshBlood]
15
17
  @is_hot_streak = attributes[:isHotStreak]
16
18
  @is_inactive = attributes[:isInactive]
@@ -29,4 +31,4 @@ module ::LeagueOfLegends
29
31
 
30
32
  end
31
33
  end
32
- end
34
+ end
@@ -9,8 +9,10 @@ module ::LeagueOfLegends
9
9
  end
10
10
 
11
11
  attr_reader :losses, :progress, :target, :time_left_to_play_millis, :wins
12
-
12
+
13
13
  def initialize attributes
14
+ return if attributes.nil?
15
+
14
16
  @losses = attributes[:losses]
15
17
  @progress = attributes[:progress]
16
18
  @target = attributes[:target]
@@ -20,4 +22,4 @@ module ::LeagueOfLegends
20
22
 
21
23
  end
22
24
  end
23
- end
25
+ end
@@ -9,6 +9,8 @@ module ::LeagueOfLegends
9
9
  attr_reader :champion_id, :summoner_id, :team_id
10
10
 
11
11
  def initialize attributes
12
+ return if attributes.nil?
13
+
12
14
  @champion_id = attributes[:championId].to_i
13
15
  @summoner_id = attributes[:summonerId].to_i
14
16
  @team_id = attributes[:teamId].to_i
@@ -16,4 +18,4 @@ module ::LeagueOfLegends
16
18
 
17
19
  end
18
20
  end
19
- end
21
+ end
@@ -12,6 +12,8 @@ module ::LeagueOfLegends
12
12
  :losses, :modify_date, :aggregated_stats
13
13
 
14
14
  def initialize attributes
15
+ return if attributes.nil?
16
+
15
17
  @player_stat_summary_type = attributes[:playerStatSummaryType]
16
18
  @wins = attributes[:wins].to_i
17
19
  @losses = attributes[:losses].to_i
@@ -21,4 +23,4 @@ module ::LeagueOfLegends
21
23
 
22
24
  end
23
25
  end
24
- end
26
+ end
@@ -6,28 +6,30 @@ module ::LeagueOfLegends
6
6
  ::LeagueOfLegends::DTO::RecentGames.version
7
7
  end
8
8
 
9
- attr_reader :assists, :barracks_killed, :champions_killed, :combat_player_score,
10
- :consumables_purchased, :damage_dealt_player, :double_kills, :first_blood, :gold,
11
- :gold_earned, :gold_spent, :item_0, :item_1, :item_2, :item_3, :item_4, :item_5,
12
- :item_6, :items_purchased, :killing_sprees, :largest_critical_strike,
13
- :largest_killing_spree, :largest_multi_kill, :legendary_items_created, :level,
14
- :magic_damage_dealt_player, :magic_damage_dealt_to_champions, :magic_damage_taken,
15
- :minions_denied, :minions_killed, :neutral_minions_killed,
16
- :neutral_minions_killed_enemy_jungle, :neutral_minions_killed_your_jungle,
17
- :nexus_killed, :node_capture, :node_capture_assist, :node_neutralize,
18
- :node_neutralize_assist, :num_deaths, :num_items_bought, :objective_player_score,
19
- :penta_kills, :physical_damage_dealt_player, :physical_damage_dealt_to_champions,
20
- :physical_damage_taken, :quadra_kills, :sight_wards_bought, :spell_1_cast,
21
- :spell_2_cast, :spell_3_cast, :spell_4_cast, :summon_spell_1_cast,
22
- :summon_spell_2_cast, :super_monster_killed, :team, :team_objective,
23
- :time_played, :total_damage_dealt, :total_damage_dealt_to_champions,
24
- :total_damage_taken, :total_heal, :total_player_score, :total_score_rank,
25
- :total_time_crowd_control_dealt, :total_units_healed, :triple_kills,
26
- :true_damage_dealt_player, :true_damage_dealt_to_champions, :true_damage_taken,
27
- :turrets_killed, :unreal_kills, :victory_point_total, :vision_wards_bought,
9
+ attr_reader :assists, :barracks_killed, :champions_killed, :combat_player_score,
10
+ :consumables_purchased, :damage_dealt_player, :double_kills, :first_blood, :gold,
11
+ :gold_earned, :gold_spent, :item_0, :item_1, :item_2, :item_3, :item_4, :item_5,
12
+ :item_6, :items_purchased, :killing_sprees, :largest_critical_strike,
13
+ :largest_killing_spree, :largest_multi_kill, :legendary_items_created, :level,
14
+ :magic_damage_dealt_player, :magic_damage_dealt_to_champions, :magic_damage_taken,
15
+ :minions_denied, :minions_killed, :neutral_minions_killed,
16
+ :neutral_minions_killed_enemy_jungle, :neutral_minions_killed_your_jungle,
17
+ :nexus_killed, :node_capture, :node_capture_assist, :node_neutralize,
18
+ :node_neutralize_assist, :num_deaths, :num_items_bought, :objective_player_score,
19
+ :penta_kills, :physical_damage_dealt_player, :physical_damage_dealt_to_champions,
20
+ :physical_damage_taken, :quadra_kills, :sight_wards_bought, :spell_1_cast,
21
+ :spell_2_cast, :spell_3_cast, :spell_4_cast, :summon_spell_1_cast,
22
+ :summon_spell_2_cast, :super_monster_killed, :team, :team_objective,
23
+ :time_played, :total_damage_dealt, :total_damage_dealt_to_champions,
24
+ :total_damage_taken, :total_heal, :total_player_score, :total_score_rank,
25
+ :total_time_crowd_control_dealt, :total_units_healed, :triple_kills,
26
+ :true_damage_dealt_player, :true_damage_dealt_to_champions, :true_damage_taken,
27
+ :turrets_killed, :unreal_kills, :victory_point_total, :vision_wards_bought,
28
28
  :ward_killed, :ward_placed, :win
29
29
 
30
30
  def initialize attributes
31
+ return if attributes.nil?
32
+
31
33
  @assists = attributes[:assists].to_i
32
34
  @barracks_killed = attributes[:barracksKilled].to_i
33
35
  @champions_killed = attributes[:championsKilled].to_i
@@ -108,4 +110,4 @@ module ::LeagueOfLegends
108
110
 
109
111
  end
110
112
  end
111
- end
113
+ end
@@ -0,0 +1,23 @@
1
+ require 'league_of_legends/dto'
2
+
3
+ module ::LeagueOfLegends
4
+ module DTO
5
+ class TeamMap < ::LeagueOfLegends::DTO::Base
6
+
7
+ def self.version
8
+ ::LeagueOfLegends::DTO::Team.version
9
+ end
10
+
11
+ attr_reader :get
12
+
13
+ def initialize json
14
+ attributes = build_attributes json
15
+
16
+ @get = attributes.each_with_object({}) do |(team_id, team_dto), map|
17
+ map[team_id.to_s] = ::LeagueOfLegends::DTO::Team.new(team_dto)
18
+ end
19
+ end
20
+
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  module LeagueOfLegends
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
@@ -0,0 +1,71 @@
1
+ require_relative '../spec_helper'
2
+
3
+ describe ::LeagueOfLegends::DTO::TeamMap do
4
+
5
+ let(:json) {
6
+ %q({"TEAM-90e87e50-5131-11e3-ad58-782bcb4ce61a": {
7
+ "teamStatSummary": {
8
+ "fullId": "TEAM-90e87e50-5131-11e3-ad58-782bcb4ce61a",
9
+ "teamStatDetails": [
10
+ {
11
+ "fullId": "TEAM-90e87e50-5131-11e3-ad58-782bcb4ce61a",
12
+ "losses": 0,
13
+ "averageGamesPlayed": 0,
14
+ "wins": 0,
15
+ "teamStatType": "RANKED_TEAM_5x5"
16
+ }
17
+ ]
18
+ },
19
+ "status": "RANKED",
20
+ "tag": "MMosh",
21
+ "roster": {
22
+ "ownerId": 24907958,
23
+ "memberList": [
24
+ {
25
+ "joinDate": 1384875907000,
26
+ "inviteDate": 1384875907000,
27
+ "status": "MEMBER",
28
+ "playerId": 24907958
29
+ }
30
+ ]
31
+ },
32
+ "lastGameDate": 1392668305000,
33
+ "modifyDate": 1392668305000,
34
+ "fullId": "TEAM-90e87e50-5131-11e3-ad58-782bcb4ce61a",
35
+ "lastJoinDate": 1388178602000,
36
+ "secondLastJoinDate": 1384955161000,
37
+ "matchHistory": [
38
+ {
39
+ "gameMode": "CLASSIC",
40
+ "mapId": 10,
41
+ "assists": 7,
42
+ "opposingTeamName": "Infected Dream",
43
+ "invalid": false,
44
+ "deaths": 10,
45
+ "gameId": 1331312632,
46
+ "kills": 5,
47
+ "win": false,
48
+ "date": 1392668306007,
49
+ "opposingTeamKills": 10
50
+ }
51
+ ],
52
+ "lastJoinedRankedTeamQueueDate": 1392666922000,
53
+ "name": "Metal Moshpit",
54
+ "thirdLastJoinDate": 1384899325000,
55
+ "createDate": 1384875907000
56
+ }})
57
+ }
58
+ let(:dto){ described_class.new(json) }
59
+
60
+ it "has attributes" do
61
+ dto.get.each_pair do |team_id, team_dto|
62
+ expect(team_id).to eq "TEAM-90e87e50-5131-11e3-ad58-782bcb4ce61a"
63
+ expect(team_dto).to be_an_instance_of ::LeagueOfLegends::DTO::Team
64
+ end
65
+ end
66
+
67
+ it "has a version" do
68
+ expect(described_class.version).to eq 'v2.2'
69
+ end
70
+
71
+ end
metadata CHANGED
@@ -1,89 +1,89 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: league_of_legends
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francisco Orvalho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-22 00:00:00.000000000 Z
11
+ date: 2014-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.5'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.5'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.14.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.14.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: vcr
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '2.8'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '2.8'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: webmock
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: 1.8.0
76
- - - <
76
+ - - "<"
77
77
  - !ruby/object:Gem::Version
78
78
  version: '1.16'
79
79
  type: :development
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
- - - '>='
83
+ - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: 1.8.0
86
- - - <
86
+ - - "<"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '1.16'
89
89
  description: |-
@@ -97,8 +97,8 @@ executables: []
97
97
  extensions: []
98
98
  extra_rdoc_files: []
99
99
  files:
100
- - .gitignore
101
- - .travis.yml
100
+ - ".gitignore"
101
+ - ".travis.yml"
102
102
  - Gemfile
103
103
  - LICENSE.txt
104
104
  - README.md
@@ -128,6 +128,7 @@ files:
128
128
  - lib/league_of_legends/dto/recent_games.rb
129
129
  - lib/league_of_legends/dto/roster.rb
130
130
  - lib/league_of_legends/dto/team.rb
131
+ - lib/league_of_legends/dto/team_map.rb
131
132
  - lib/league_of_legends/dto/team_member_info.rb
132
133
  - lib/league_of_legends/dto/team_stat_detail.rb
133
134
  - lib/league_of_legends/dto/team_stat_summary.rb
@@ -172,6 +173,7 @@ files:
172
173
  - spec/league_of_legends/dto/raw_stats_spec.rb
173
174
  - spec/league_of_legends/dto/recent_games_spec.rb
174
175
  - spec/league_of_legends/dto/roster_spec.rb
176
+ - spec/league_of_legends/dto/team_map_spec.rb
175
177
  - spec/league_of_legends/dto/team_member_info_spec.rb
176
178
  - spec/league_of_legends/dto/team_spec.rb
177
179
  - spec/league_of_legends/dto/team_stat_detail_spec.rb
@@ -197,17 +199,17 @@ require_paths:
197
199
  - lib
198
200
  required_ruby_version: !ruby/object:Gem::Requirement
199
201
  requirements:
200
- - - '>='
202
+ - - ">="
201
203
  - !ruby/object:Gem::Version
202
204
  version: '0'
203
205
  required_rubygems_version: !ruby/object:Gem::Requirement
204
206
  requirements:
205
- - - '>='
207
+ - - ">="
206
208
  - !ruby/object:Gem::Version
207
209
  version: '0'
208
210
  requirements: []
209
211
  rubyforge_project:
210
- rubygems_version: 2.0.14
212
+ rubygems_version: 2.2.0
211
213
  signing_key:
212
214
  specification_version: 4
213
215
  summary: Implementation of the LoL API
@@ -242,6 +244,7 @@ test_files:
242
244
  - spec/league_of_legends/dto/raw_stats_spec.rb
243
245
  - spec/league_of_legends/dto/recent_games_spec.rb
244
246
  - spec/league_of_legends/dto/roster_spec.rb
247
+ - spec/league_of_legends/dto/team_map_spec.rb
245
248
  - spec/league_of_legends/dto/team_member_info_spec.rb
246
249
  - spec/league_of_legends/dto/team_spec.rb
247
250
  - spec/league_of_legends/dto/team_stat_detail_spec.rb