league_of_legends 0.0.10 → 0.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/league_of_legends/dto.rb +8 -1
- data/lib/league_of_legends/dto/match_history_summary.rb +30 -0
- data/lib/league_of_legends/dto/message_of_day.rb +21 -0
- data/lib/league_of_legends/dto/roster.rb +22 -0
- data/lib/league_of_legends/dto/team.rb +35 -0
- data/lib/league_of_legends/dto/team_member_info.rb +22 -0
- data/lib/league_of_legends/dto/team_stat_detail.rb +23 -0
- data/lib/league_of_legends/dto/team_stat_summary.rb +22 -0
- data/lib/league_of_legends/request.rb +1 -2
- data/lib/league_of_legends/version.rb +1 -1
- data/spec/league_of_legends/dto/match_history_summary_spec.rb +38 -0
- data/spec/league_of_legends/dto/message_of_day_spec.rb +22 -0
- data/spec/league_of_legends/dto/roster_spec.rb +61 -0
- data/spec/league_of_legends/dto/team_member_info_spec.rb +24 -0
- data/spec/league_of_legends/dto/team_spec.rb +84 -0
- data/spec/league_of_legends/dto/team_stat_detail_spec.rb +26 -0
- data/spec/league_of_legends/dto/team_stat_summary_spec.rb +39 -0
- metadata +23 -3
- data/lib/league_of_legends/request/all.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e79fae4fe5d15a9156e647c7baa01139f6cade3
|
4
|
+
data.tar.gz: f44d28c489dd3c209a6f373e1bfba91564ac3cbc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff03a8eabdc3c3d8c0265d02a38fed86ff2c080e5a955ed24ba07c67cdc324c4458585a954162c04a5825896ed4ae4d9272ac8e2df4ae94f1477b6aaac90952f
|
7
|
+
data.tar.gz: af9a9a67886fb408e6976f8508c057944392c0f04c22bada2aa7520571cd2f17ceca4653336165f711b288a7521570ff18b81461a04212a51e2824bcea0cbfc6
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# league_of_legends [![Build Status](https://travis-ci.org/forvalho/league_of_legends.png?branch=master)](https://travis-ci.org/forvalho/league_of_legends)
|
1
|
+
# league_of_legends [![Build Status](https://travis-ci.org/forvalho/league_of_legends.png?branch=master)](https://travis-ci.org/forvalho/league_of_legends) [![Dependency Status](https://gemnasium.com/forvalho/league_of_legends.png)](https://gemnasium.com/forvalho/league_of_legends) [![Code Climate](https://codeclimate.com/github/forvalho/league_of_legends.png)](https://codeclimate.com/github/forvalho/league_of_legends)
|
2
2
|
|
3
3
|
This gem implements the League Of Legends API (currently in open beta). It will continue to be updated as the API evolves.
|
4
4
|
|
@@ -8,10 +8,17 @@ require 'league_of_legends/dto/league'
|
|
8
8
|
require 'league_of_legends/dto/league_item'
|
9
9
|
require 'league_of_legends/dto/league_item_list'
|
10
10
|
require 'league_of_legends/dto/league_list'
|
11
|
+
require 'league_of_legends/dto/match_history_summary'
|
12
|
+
require 'league_of_legends/dto/message_of_day'
|
11
13
|
require 'league_of_legends/dto/mini_series'
|
12
14
|
require 'league_of_legends/dto/player'
|
13
15
|
require 'league_of_legends/dto/player_stats_summary'
|
14
16
|
require 'league_of_legends/dto/player_stats_summary_list'
|
15
17
|
require 'league_of_legends/dto/ranked_stats'
|
16
18
|
require 'league_of_legends/dto/raw_stats'
|
17
|
-
require 'league_of_legends/dto/recent_games'
|
19
|
+
require 'league_of_legends/dto/recent_games'
|
20
|
+
require 'league_of_legends/dto/roster'
|
21
|
+
require 'league_of_legends/dto/team'
|
22
|
+
require 'league_of_legends/dto/team_member_info'
|
23
|
+
require 'league_of_legends/dto/team_stat_detail'
|
24
|
+
require 'league_of_legends/dto/team_stat_summary'
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module ::LeagueOfLegends
|
2
|
+
module DTO
|
3
|
+
class MatchHistorySummary
|
4
|
+
|
5
|
+
def self.version
|
6
|
+
::LeagueOfLegends::DTO::Team.version
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_reader :assists, :date, :deaths, :game_id, :game_mode, :invalid,
|
10
|
+
:kills, :map_id, :opposing_team_kills, :opposing_team_name, :win
|
11
|
+
|
12
|
+
def initialize attributes
|
13
|
+
return if attributes.nil?
|
14
|
+
|
15
|
+
@assists = attributes[:assists]
|
16
|
+
@date = Time.at(attributes[:date]/1000)
|
17
|
+
@deaths = attributes[:deaths]
|
18
|
+
@game_id = attributes[:gameId]
|
19
|
+
@game_mode = attributes[:gameMode]
|
20
|
+
@invalid = attributes[:invalid]
|
21
|
+
@kills = attributes[:kills]
|
22
|
+
@map_id = attributes[:mapId]
|
23
|
+
@opposing_team_kills = attributes[:opposingTeamKills]
|
24
|
+
@opposing_team_name = attributes[:opposingTeamName]
|
25
|
+
@win = attributes[:win]
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module ::LeagueOfLegends
|
2
|
+
module DTO
|
3
|
+
class MessageOfDay
|
4
|
+
|
5
|
+
def self.version
|
6
|
+
::LeagueOfLegends::DTO::Team.version
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_reader :create_date, :message, :version
|
10
|
+
|
11
|
+
def initialize attributes
|
12
|
+
return if attributes.nil?
|
13
|
+
|
14
|
+
@create_date = Time.at(attributes[:createDate]/1000)
|
15
|
+
@message = attributes[:message]
|
16
|
+
@version = attributes[:version]
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module ::LeagueOfLegends
|
2
|
+
module DTO
|
3
|
+
class Roster
|
4
|
+
|
5
|
+
def self.version
|
6
|
+
::LeagueOfLegends::DTO::Team.version
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_reader :owner_id, :member_list
|
10
|
+
|
11
|
+
def initialize attributes
|
12
|
+
return if attributes.nil?
|
13
|
+
|
14
|
+
@owner_id = attributes[:ownerId]
|
15
|
+
@member_list = attributes[:memberList].map do |member|
|
16
|
+
::LeagueOfLegends::DTO::TeamMemberInfo.new(member)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
module ::LeagueOfLegends
|
2
|
+
module DTO
|
3
|
+
class Team < ::LeagueOfLegends::DTO::Base
|
4
|
+
|
5
|
+
def self.version
|
6
|
+
'v2.2'
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_reader :x, :create_date, :full_id, :last_game_date, :last_join_date, :last_joined_ranked_team_queue_date, :match_history, :message_of_day, :modify_date, :name, :roster, :second_last_join_date, :status, :tag, :team_stat_summary, :third_last_join_date
|
10
|
+
|
11
|
+
def initialize attributes
|
12
|
+
return if attributes.nil?
|
13
|
+
|
14
|
+
@create_date = Time.at(attributes[:createDate]/1000)
|
15
|
+
@full_id = attributes[:fullId]
|
16
|
+
@last_game_date = Time.at(attributes[:lastGameDate]/1000)
|
17
|
+
@last_join_date = Time.at(attributes[:lastJoinDate]/1000)
|
18
|
+
@last_joined_ranked_team_queue_date = Time.at(attributes[:lastJoinedRankedTeamQueueDate]/1000)
|
19
|
+
@match_history = attributes[:matchHistory].map do |match|
|
20
|
+
::LeagueOfLegends::DTO::MatchHistorySummary.new(match)
|
21
|
+
end
|
22
|
+
@message_of_day = ::LeagueOfLegends::DTO::MessageOfDay.new(attributes[:messageOfDay])
|
23
|
+
@modify_date = Time.at(attributes[:modifyDate]/1000)
|
24
|
+
@name = attributes[:name]
|
25
|
+
@roster = ::LeagueOfLegends::DTO::Roster.new(attributes[:roster])
|
26
|
+
@second_last_join_date = Time.at(attributes[:secondLastJoinDate]/1000)
|
27
|
+
@status = attributes[:status]
|
28
|
+
@tag = attributes[:tag]
|
29
|
+
@team_stat_summary = ::LeagueOfLegends::DTO::TeamStatSummary.new(attributes[:teamStatSummary])
|
30
|
+
@third_last_join_date = Time.at(attributes[:thirdLastJoinDate]/1000)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module ::LeagueOfLegends
|
2
|
+
module DTO
|
3
|
+
class TeamMemberInfo
|
4
|
+
|
5
|
+
def self.version
|
6
|
+
::LeagueOfLegends::DTO::Team.version
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_reader :join_date, :invite_date, :status, :player_id
|
10
|
+
|
11
|
+
def initialize attributes
|
12
|
+
return if attributes.nil?
|
13
|
+
|
14
|
+
@join_date = Time.at(attributes[:joinDate]/1000)
|
15
|
+
@invite_date = Time.at(attributes[:inviteDate]/1000)
|
16
|
+
@status = attributes[:status]
|
17
|
+
@player_id = attributes[:playerId]
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module ::LeagueOfLegends
|
2
|
+
module DTO
|
3
|
+
class TeamStatDetail
|
4
|
+
|
5
|
+
def self.version
|
6
|
+
::LeagueOfLegends::DTO::Team.version
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_reader :average_games_played, :full_id, :losses, :team_stat_type, :wins
|
10
|
+
|
11
|
+
def initialize attributes
|
12
|
+
return if attributes.nil?
|
13
|
+
|
14
|
+
@average_games_played = attributes[:averageGamesPlayed]
|
15
|
+
@full_id = attributes[:fullId]
|
16
|
+
@losses = attributes[:losses]
|
17
|
+
@team_stat_type = attributes[:teamStatType]
|
18
|
+
@wins = attributes[:wins]
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module ::LeagueOfLegends
|
2
|
+
module DTO
|
3
|
+
class TeamStatSummary
|
4
|
+
|
5
|
+
def self.version
|
6
|
+
::LeagueOfLegends::DTO::Team.version
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_reader :full_id, :team_stat_details
|
10
|
+
|
11
|
+
def initialize attributes
|
12
|
+
return if attributes.nil?
|
13
|
+
|
14
|
+
@full_id = attributes[:fullId]
|
15
|
+
@team_stat_details = attributes[:teamStatDetails].map do |detail|
|
16
|
+
::LeagueOfLegends::DTO::TeamStatDetail.new(detail)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'league_of_legends/request/all'
|
2
1
|
require 'league_of_legends/request/base'
|
3
2
|
require 'league_of_legends/request/champion'
|
4
3
|
require 'league_of_legends/request/game/by_summoner/recent'
|
@@ -7,4 +6,4 @@ require 'league_of_legends/request/league/by_summoner/entry'
|
|
7
6
|
require 'league_of_legends/request/league/challenger'
|
8
7
|
require 'league_of_legends/request/mapper'
|
9
8
|
require 'league_of_legends/request/stats/by_summoner/ranked'
|
10
|
-
require 'league_of_legends/request/stats/by_summoner/summary'
|
9
|
+
require 'league_of_legends/request/stats/by_summoner/summary'
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
describe ::LeagueOfLegends::DTO::MatchHistorySummary do
|
4
|
+
|
5
|
+
let(:json) { {
|
6
|
+
gameMode: "CLASSIC",
|
7
|
+
mapId: 10,
|
8
|
+
assists: 15,
|
9
|
+
opposingTeamName: "We Are Kput",
|
10
|
+
invalid: false,
|
11
|
+
deaths: 6,
|
12
|
+
gameId: 1325039575,
|
13
|
+
kills: 13,
|
14
|
+
win: true,
|
15
|
+
date: 1392398336953,
|
16
|
+
opposingTeamKills: 6
|
17
|
+
} }
|
18
|
+
let(:dto){ described_class.new(json) }
|
19
|
+
|
20
|
+
it "has attributes" do
|
21
|
+
expect(dto.game_mode).to eq "CLASSIC"
|
22
|
+
expect(dto.map_id).to eq 10
|
23
|
+
expect(dto.assists).to eq 15
|
24
|
+
expect(dto.opposing_team_name).to eq "We Are Kput"
|
25
|
+
expect(dto.invalid).to be_false
|
26
|
+
expect(dto.deaths).to eq 6
|
27
|
+
expect(dto.game_id).to eq 1325039575
|
28
|
+
expect(dto.kills).to eq 13
|
29
|
+
expect(dto.win).to be_true
|
30
|
+
expect(dto.date).to eq Time.at(1392398336953/1000)
|
31
|
+
expect(dto.opposing_team_kills).to eq 6
|
32
|
+
end
|
33
|
+
|
34
|
+
it "has a version" do
|
35
|
+
expect(described_class.version).to eq 'v2.2'
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
describe ::LeagueOfLegends::DTO::MessageOfDay do
|
4
|
+
|
5
|
+
let(:json) { {
|
6
|
+
createDate: 1389546389000,
|
7
|
+
message: "MotD",
|
8
|
+
version: 123
|
9
|
+
} }
|
10
|
+
let(:dto){ described_class.new(json) }
|
11
|
+
|
12
|
+
it "has attributes" do
|
13
|
+
expect(dto.create_date).to eq Time.at(1389546389000/1000)
|
14
|
+
expect(dto.message).to eq "MotD"
|
15
|
+
expect(dto.version).to eq 123
|
16
|
+
end
|
17
|
+
|
18
|
+
it "has a version" do
|
19
|
+
expect(described_class.version).to eq 'v2.2'
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
describe ::LeagueOfLegends::DTO::Roster do
|
4
|
+
|
5
|
+
let(:json) { {
|
6
|
+
ownerId: 31747504,
|
7
|
+
memberList: [
|
8
|
+
{
|
9
|
+
joinDate: 1389546389000,
|
10
|
+
inviteDate: 1389546389000,
|
11
|
+
status: "MEMBER",
|
12
|
+
playerId: 31747504
|
13
|
+
},
|
14
|
+
{
|
15
|
+
joinDate: 1389546412000,
|
16
|
+
inviteDate: 1389546405000,
|
17
|
+
status: "MEMBER",
|
18
|
+
playerId: 46278132
|
19
|
+
},
|
20
|
+
{
|
21
|
+
joinDate: 1389637384000,
|
22
|
+
inviteDate: 1389546413000,
|
23
|
+
status: "MEMBER",
|
24
|
+
playerId: 45297413
|
25
|
+
},
|
26
|
+
{
|
27
|
+
joinDate: 1389546460000,
|
28
|
+
inviteDate: 1389546429000,
|
29
|
+
status: "MEMBER",
|
30
|
+
playerId: 45097419
|
31
|
+
},
|
32
|
+
{
|
33
|
+
joinDate: 1389728184000,
|
34
|
+
inviteDate: 1389728157000,
|
35
|
+
status: "MEMBER",
|
36
|
+
playerId: 31350004
|
37
|
+
},
|
38
|
+
{
|
39
|
+
joinDate: 1390087488000,
|
40
|
+
inviteDate: 1390087483000,
|
41
|
+
status: "MEMBER",
|
42
|
+
playerId: 31809264
|
43
|
+
}
|
44
|
+
]
|
45
|
+
} }
|
46
|
+
let(:dto){ described_class.new(json) }
|
47
|
+
|
48
|
+
it "has attributes" do
|
49
|
+
expect(dto.owner_id).to eq 31747504
|
50
|
+
expect(dto.member_list).to be_an_instance_of Array
|
51
|
+
expect(dto.member_list.size).to eq 6
|
52
|
+
dto.member_list.each do |member|
|
53
|
+
expect(member).to be_an_instance_of ::LeagueOfLegends::DTO::TeamMemberInfo
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
it "has a version" do
|
58
|
+
expect(described_class.version).to eq 'v2.2'
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
describe ::LeagueOfLegends::DTO::TeamMemberInfo do
|
4
|
+
|
5
|
+
let(:json) { {
|
6
|
+
joinDate: 1389546389000,
|
7
|
+
inviteDate: 1389546389000,
|
8
|
+
status: "MEMBER",
|
9
|
+
playerId: 31747504
|
10
|
+
} }
|
11
|
+
let(:dto){ described_class.new(json) }
|
12
|
+
|
13
|
+
it "has attributes" do
|
14
|
+
expect(dto.join_date).to eq Time.at(1389546389000/1000)
|
15
|
+
expect(dto.invite_date).to eq Time.at(1389546389000/1000)
|
16
|
+
expect(dto.status).to eq "MEMBER"
|
17
|
+
expect(dto.player_id).to eq 31747504
|
18
|
+
end
|
19
|
+
|
20
|
+
it "has a version" do
|
21
|
+
expect(described_class.version).to eq 'v2.2'
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
describe ::LeagueOfLegends::DTO::Team do
|
4
|
+
|
5
|
+
let(:json) { {
|
6
|
+
teamStatSummary: {
|
7
|
+
fullId: "TEAM-90e87e50-5131-11e3-ad58-782bcb4ce61a",
|
8
|
+
teamStatDetails: [
|
9
|
+
{
|
10
|
+
fullId: "TEAM-90e87e50-5131-11e3-ad58-782bcb4ce61a",
|
11
|
+
losses: 0,
|
12
|
+
averageGamesPlayed: 0,
|
13
|
+
wins: 2,
|
14
|
+
teamStatType: "RANKED_TEAM_3x3"
|
15
|
+
}
|
16
|
+
]
|
17
|
+
},
|
18
|
+
status: "RANKED",
|
19
|
+
tag: "MMosh",
|
20
|
+
roster: {
|
21
|
+
ownerId: 24907958,
|
22
|
+
memberList: [
|
23
|
+
{
|
24
|
+
joinDate: 1388178602000,
|
25
|
+
inviteDate: 1388178598000,
|
26
|
+
status: "MEMBER",
|
27
|
+
playerId: 19496585
|
28
|
+
}
|
29
|
+
]
|
30
|
+
},
|
31
|
+
lastGameDate: 1392398336000,
|
32
|
+
modifyDate: 1392398336000,
|
33
|
+
fullId: "TEAM-90e87e50-5131-11e3-ad58-782bcb4ce61a",
|
34
|
+
lastJoinDate: 1388178602000,
|
35
|
+
secondLastJoinDate: 1384955161000,
|
36
|
+
matchHistory: [
|
37
|
+
{
|
38
|
+
gameMode: "CLASSIC",
|
39
|
+
mapId: 10,
|
40
|
+
assists: 24,
|
41
|
+
opposingTeamName: "NEO ESPAÑOLITOS",
|
42
|
+
invalid: false,
|
43
|
+
deaths: 10,
|
44
|
+
gameId: 1177371227,
|
45
|
+
kills: 21,
|
46
|
+
win: true,
|
47
|
+
date: 1384960069483,
|
48
|
+
opposingTeamKills: 10
|
49
|
+
}
|
50
|
+
],
|
51
|
+
lastJoinedRankedTeamQueueDate: 1392396869000,
|
52
|
+
name: "Metal Moshpit",
|
53
|
+
thirdLastJoinDate: 1384899325000,
|
54
|
+
createDate: 1384875907000
|
55
|
+
} }
|
56
|
+
let(:dto){ described_class.new(json) }
|
57
|
+
|
58
|
+
it "has attributes" do
|
59
|
+
expect(dto.team_stat_summary).to be_an_instance_of ::LeagueOfLegends::DTO::TeamStatSummary
|
60
|
+
expect(dto.status).to eq "RANKED"
|
61
|
+
expect(dto.tag).to eq "MMosh"
|
62
|
+
expect(dto.roster).to be_an_instance_of ::LeagueOfLegends::DTO::Roster
|
63
|
+
expect(dto.last_game_date).to eq Time.at(1392398336)
|
64
|
+
expect(dto.modify_date).to eq Time.at(1392398336)
|
65
|
+
expect(dto.full_id).to eq "TEAM-90e87e50-5131-11e3-ad58-782bcb4ce61a"
|
66
|
+
expect(dto.last_join_date).to eq Time.at(1388178602)
|
67
|
+
expect(dto.second_last_join_date).to eq Time.at(1384955161)
|
68
|
+
expect(dto.match_history).to be_an_instance_of Array
|
69
|
+
expect(dto.match_history.size).to eq 1
|
70
|
+
dto.match_history.each do |match|
|
71
|
+
expect(match).to be_an_instance_of ::LeagueOfLegends::DTO::MatchHistorySummary
|
72
|
+
end
|
73
|
+
expect(dto.last_joined_ranked_team_queue_date).to eq Time.at(1392396869)
|
74
|
+
expect(dto.name).to eq "Metal Moshpit"
|
75
|
+
expect(dto.third_last_join_date).to eq Time.at(1384899325)
|
76
|
+
expect(dto.create_date).to eq Time.at(1384875907)
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
it "has a version" do
|
81
|
+
expect(described_class.version).to eq 'v2.2'
|
82
|
+
end
|
83
|
+
|
84
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
describe ::LeagueOfLegends::DTO::TeamStatDetail do
|
4
|
+
|
5
|
+
let(:json) { {
|
6
|
+
averageGamesPlayed: 0,
|
7
|
+
fullId: "TEAM-e106f340-7bab-11e3-bc48-782bcb4ce61a",
|
8
|
+
losses: 0,
|
9
|
+
teamStatType: "RANKED_TEAM_5x5",
|
10
|
+
wins: 0
|
11
|
+
} }
|
12
|
+
let(:dto){ described_class.new(json) }
|
13
|
+
|
14
|
+
it "has attributes" do
|
15
|
+
expect(dto.average_games_played).to eq 0
|
16
|
+
expect(dto.full_id).to eq "TEAM-e106f340-7bab-11e3-bc48-782bcb4ce61a"
|
17
|
+
expect(dto.losses).to eq 0
|
18
|
+
expect(dto.team_stat_type).to eq "RANKED_TEAM_5x5"
|
19
|
+
expect(dto.wins).to eq 0
|
20
|
+
end
|
21
|
+
|
22
|
+
it "has a version" do
|
23
|
+
expect(described_class.version).to eq 'v2.2'
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require_relative '../spec_helper'
|
2
|
+
|
3
|
+
describe ::LeagueOfLegends::DTO::TeamStatSummary do
|
4
|
+
|
5
|
+
let(:json) { {
|
6
|
+
fullId: "TEAM-90e87e50-5131-11e3-ad58-782bcb4ce61a",
|
7
|
+
teamStatDetails: [
|
8
|
+
{
|
9
|
+
fullId: "TEAM-90e87e50-5131-11e3-ad58-782bcb4ce61a",
|
10
|
+
losses: 0,
|
11
|
+
averageGamesPlayed: 0,
|
12
|
+
wins: 0,
|
13
|
+
teamStatType: "RANKED_TEAM_5x5"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
fullId: "TEAM-90e87e50-5131-11e3-ad58-782bcb4ce61a",
|
17
|
+
losses: 0,
|
18
|
+
averageGamesPlayed: 0,
|
19
|
+
wins: 2,
|
20
|
+
teamStatType: "RANKED_TEAM_3x3"
|
21
|
+
}
|
22
|
+
]
|
23
|
+
} }
|
24
|
+
let(:dto){ described_class.new(json) }
|
25
|
+
|
26
|
+
it "has attributes" do
|
27
|
+
expect(dto.full_id).to eq "TEAM-90e87e50-5131-11e3-ad58-782bcb4ce61a"
|
28
|
+
expect(dto.team_stat_details).to be_an_instance_of Array
|
29
|
+
expect(dto.team_stat_details.size).to eq 2
|
30
|
+
dto.team_stat_details.each do |detail|
|
31
|
+
expect(detail).to be_an_instance_of ::LeagueOfLegends::DTO::TeamStatDetail
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
it "has a version" do
|
36
|
+
expect(described_class.version).to eq 'v2.2'
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: league_of_legends
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.11
|
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-
|
11
|
+
date: 2014-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -117,6 +117,8 @@ files:
|
|
117
117
|
- lib/league_of_legends/dto/league_item.rb
|
118
118
|
- lib/league_of_legends/dto/league_item_list.rb
|
119
119
|
- lib/league_of_legends/dto/league_list.rb
|
120
|
+
- lib/league_of_legends/dto/match_history_summary.rb
|
121
|
+
- lib/league_of_legends/dto/message_of_day.rb
|
120
122
|
- lib/league_of_legends/dto/mini_series.rb
|
121
123
|
- lib/league_of_legends/dto/player.rb
|
122
124
|
- lib/league_of_legends/dto/player_stats_summary.rb
|
@@ -124,8 +126,12 @@ files:
|
|
124
126
|
- lib/league_of_legends/dto/ranked_stats.rb
|
125
127
|
- lib/league_of_legends/dto/raw_stats.rb
|
126
128
|
- lib/league_of_legends/dto/recent_games.rb
|
129
|
+
- lib/league_of_legends/dto/roster.rb
|
130
|
+
- lib/league_of_legends/dto/team.rb
|
131
|
+
- lib/league_of_legends/dto/team_member_info.rb
|
132
|
+
- lib/league_of_legends/dto/team_stat_detail.rb
|
133
|
+
- lib/league_of_legends/dto/team_stat_summary.rb
|
127
134
|
- lib/league_of_legends/request.rb
|
128
|
-
- lib/league_of_legends/request/all.rb
|
129
135
|
- lib/league_of_legends/request/base.rb
|
130
136
|
- lib/league_of_legends/request/champion.rb
|
131
137
|
- lib/league_of_legends/request/game/by_summoner/recent.rb
|
@@ -156,6 +162,8 @@ files:
|
|
156
162
|
- spec/league_of_legends/dto/league_item_spec.rb
|
157
163
|
- spec/league_of_legends/dto/league_list_spec.rb
|
158
164
|
- spec/league_of_legends/dto/league_spec.rb
|
165
|
+
- spec/league_of_legends/dto/match_history_summary_spec.rb
|
166
|
+
- spec/league_of_legends/dto/message_of_day_spec.rb
|
159
167
|
- spec/league_of_legends/dto/mini_series_spec.rb
|
160
168
|
- spec/league_of_legends/dto/player_spec.rb
|
161
169
|
- spec/league_of_legends/dto/player_stats_summary_list_spec.rb
|
@@ -163,6 +171,11 @@ files:
|
|
163
171
|
- spec/league_of_legends/dto/ranked_stats_spec.rb
|
164
172
|
- spec/league_of_legends/dto/raw_stats_spec.rb
|
165
173
|
- spec/league_of_legends/dto/recent_games_spec.rb
|
174
|
+
- spec/league_of_legends/dto/roster_spec.rb
|
175
|
+
- spec/league_of_legends/dto/team_member_info_spec.rb
|
176
|
+
- spec/league_of_legends/dto/team_spec.rb
|
177
|
+
- spec/league_of_legends/dto/team_stat_detail_spec.rb
|
178
|
+
- spec/league_of_legends/dto/team_stat_summary_spec.rb
|
166
179
|
- spec/league_of_legends/request/base_spec.rb
|
167
180
|
- spec/league_of_legends/request/champion_spec.rb
|
168
181
|
- spec/league_of_legends/request/game/by_summoner/recent_spec.rb
|
@@ -219,6 +232,8 @@ test_files:
|
|
219
232
|
- spec/league_of_legends/dto/league_item_spec.rb
|
220
233
|
- spec/league_of_legends/dto/league_list_spec.rb
|
221
234
|
- spec/league_of_legends/dto/league_spec.rb
|
235
|
+
- spec/league_of_legends/dto/match_history_summary_spec.rb
|
236
|
+
- spec/league_of_legends/dto/message_of_day_spec.rb
|
222
237
|
- spec/league_of_legends/dto/mini_series_spec.rb
|
223
238
|
- spec/league_of_legends/dto/player_spec.rb
|
224
239
|
- spec/league_of_legends/dto/player_stats_summary_list_spec.rb
|
@@ -226,6 +241,11 @@ test_files:
|
|
226
241
|
- spec/league_of_legends/dto/ranked_stats_spec.rb
|
227
242
|
- spec/league_of_legends/dto/raw_stats_spec.rb
|
228
243
|
- spec/league_of_legends/dto/recent_games_spec.rb
|
244
|
+
- spec/league_of_legends/dto/roster_spec.rb
|
245
|
+
- spec/league_of_legends/dto/team_member_info_spec.rb
|
246
|
+
- spec/league_of_legends/dto/team_spec.rb
|
247
|
+
- spec/league_of_legends/dto/team_stat_detail_spec.rb
|
248
|
+
- spec/league_of_legends/dto/team_stat_summary_spec.rb
|
229
249
|
- spec/league_of_legends/request/base_spec.rb
|
230
250
|
- spec/league_of_legends/request/champion_spec.rb
|
231
251
|
- spec/league_of_legends/request/game/by_summoner/recent_spec.rb
|
File without changes
|