RitoPlz 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.
@@ -0,0 +1,30 @@
1
+ require 'RitoPlz/API/base'
2
+ require 'RitoPlz/API/request'
3
+
4
+ module RitoPlz
5
+ module API
6
+ class Team < Base
7
+ def initialize(region)
8
+ @region = region
9
+ end
10
+
11
+ def by_player_ids(*ids)
12
+ ids_string = ids.join(',')
13
+ request = Request.new(@region, api_path("/by-summoner/#{ids_string}"))
14
+ request.get
15
+ end
16
+
17
+ def by_ids(*ids)
18
+ ids_string = ids.join(',')
19
+ request = Request.new(@region, api_path("/#{ids_string}"))
20
+ request.get
21
+ end
22
+
23
+ protected
24
+
25
+ def api_path(additional_path = "")
26
+ "/api/lol/#{@region}/v2.4/team" + additional_path
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,51 @@
1
+ require 'RitoPlz/API/base'
2
+ require 'RitoPlz/API/request'
3
+
4
+ module RitoPlz
5
+ module API
6
+ class Tournament < Base
7
+ def initialize(region)
8
+ @region = region
9
+ end
10
+
11
+ def generate_code(tournament_id, params)
12
+ query_params = { tournamentId: tournament_id, count: params[:count] || 1 }
13
+ params.delete(:count)
14
+ request = Request.new(@region, api_path('/code'))
15
+ request.post(params, query_params)
16
+ end
17
+
18
+ def get_code_info(tournament_code)
19
+ request = Request.new(@region, api_path("/code/#{tournament_code}"))
20
+ request.get
21
+ end
22
+
23
+ def update_code_info(tournament_code, params)
24
+ request = Request.new(@region, api_path("/code/#{tournament_code}"))
25
+ request.put(params)
26
+ end
27
+
28
+ def get_lobby_events(tournament_code)
29
+ request = Request.new(@region, api_path("/lobby/events/by-code/#{tournament_code}"))
30
+ request.get
31
+ end
32
+
33
+ def create_provider(params)
34
+ params[:region] ||= @region
35
+ request = Request.new(@region, api_path('/provider'))
36
+ request.post(params)
37
+ end
38
+
39
+ def create_tournament(params)
40
+ request = Request.new(@region, api_path('/tournament'))
41
+ request.post(params)
42
+ end
43
+
44
+ protected
45
+
46
+ def api_path(additional_path = "")
47
+ "/tournament/public/v1" + additional_path
48
+ end
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,78 @@
1
+ require 'RitoPlz/API/champion'
2
+ require 'RitoPlz/API/champion_mastery'
3
+ require 'RitoPlz/API/current_game'
4
+ require 'RitoPlz/API/featured_games'
5
+ require 'RitoPlz/API/game'
6
+ require 'RitoPlz/API/league'
7
+ require 'RitoPlz/API/static_data'
8
+ require 'RitoPlz/API/status'
9
+ require 'RitoPlz/API/match'
10
+ require 'RitoPlz/API/match_list'
11
+ require 'RitoPlz/API/stats'
12
+ require 'RitoPlz/API/summoner'
13
+ require 'RitoPlz/API/team'
14
+ require 'RitoPlz/API/tournament'
15
+
16
+ module RitoPlz
17
+ class Client
18
+ def initialize(params = {})
19
+ @region = params[:region] || RitoPlz.configuration.default_region
20
+ end
21
+
22
+ def champion
23
+ RitoPlz::API::Champion.new(@region)
24
+ end
25
+
26
+ def champion_mastery(player_id)
27
+ RitoPlz::API::ChampionMastery.new(@region, player_id)
28
+ end
29
+
30
+ def current_game
31
+ RitoPlz::API::CurrentGame.new(@region)
32
+ end
33
+
34
+ def featured_games
35
+ RitoPlz::API::FeaturedGames.new(@region)
36
+ end
37
+
38
+ def game
39
+ RitoPlz::API::Game.new(@region)
40
+ end
41
+
42
+ def league
43
+ RitoPlz::API::League.new(@region)
44
+ end
45
+
46
+ def static_data
47
+ RitoPlz::API::StaticData.new(@region)
48
+ end
49
+
50
+ def status
51
+ RitoPlz::API::Status.new(@region)
52
+ end
53
+
54
+ def match
55
+ RitoPlz::API::Match.new(@region)
56
+ end
57
+
58
+ def match_list
59
+ RitoPlz::API::MatchList.new(@region)
60
+ end
61
+
62
+ def stats(player_id)
63
+ RitoPlz::API::Stats.new(@region, player_id)
64
+ end
65
+
66
+ def summoner
67
+ RitoPlz::API::Summoner.new(@region)
68
+ end
69
+
70
+ def team
71
+ RitoPlz::API::Team.new(@region)
72
+ end
73
+
74
+ def tournament
75
+ RitoPlz::API::Tournament.new(@region)
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,10 @@
1
+ module RitoPlz
2
+ class Configuration
3
+ attr_accessor :api_key, :default_region
4
+
5
+ def initialize(params = {})
6
+ @api_key = params[:api_key] || "Please configure your API key"
7
+ @default_region = params[:default_region] || "na"
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,3 @@
1
+ module RitoPlz
2
+ VERSION = "1.0.0"
3
+ end
data/riot.txt ADDED
@@ -0,0 +1 @@
1
+ 16bc2fb8-1e27-42cb-8412-416b063db059
metadata ADDED
@@ -0,0 +1,136 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: RitoPlz
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Luke Jones
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-11-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: The aim of RitoPlz is to provide a simple, clean, and easy to use ruby
70
+ API wrapper. My priority is to provide a gem that is well documented and that you
71
+ should never get frustrated with. If I fail to meet these goals please open a bug
72
+ report in GitHub so I can fix the problem.
73
+ email:
74
+ - manhappylife@yahoo.ca
75
+ executables: []
76
+ extensions: []
77
+ extra_rdoc_files: []
78
+ files:
79
+ - ".gitignore"
80
+ - ".rspec"
81
+ - ".travis.yml"
82
+ - Gemfile
83
+ - LICENSE.txt
84
+ - README.md
85
+ - Rakefile
86
+ - RitoPlz.gemspec
87
+ - bin/console
88
+ - bin/setup
89
+ - lib/RitoPlz.rb
90
+ - lib/RitoPlz/API/README.md
91
+ - lib/RitoPlz/API/base.rb
92
+ - lib/RitoPlz/API/champion.rb
93
+ - lib/RitoPlz/API/champion_mastery.rb
94
+ - lib/RitoPlz/API/current_game.rb
95
+ - lib/RitoPlz/API/exceptions.rb
96
+ - lib/RitoPlz/API/featured_games.rb
97
+ - lib/RitoPlz/API/game.rb
98
+ - lib/RitoPlz/API/league.rb
99
+ - lib/RitoPlz/API/match.rb
100
+ - lib/RitoPlz/API/match_list.rb
101
+ - lib/RitoPlz/API/request.rb
102
+ - lib/RitoPlz/API/static_data.rb
103
+ - lib/RitoPlz/API/stats.rb
104
+ - lib/RitoPlz/API/status.rb
105
+ - lib/RitoPlz/API/summoner.rb
106
+ - lib/RitoPlz/API/team.rb
107
+ - lib/RitoPlz/API/tournament.rb
108
+ - lib/RitoPlz/client.rb
109
+ - lib/RitoPlz/configuration.rb
110
+ - lib/RitoPlz/version.rb
111
+ - riot.txt
112
+ homepage: http://github.com/gjh33/RitoPlz
113
+ licenses:
114
+ - MIT
115
+ metadata: {}
116
+ post_install_message:
117
+ rdoc_options: []
118
+ require_paths:
119
+ - lib
120
+ required_ruby_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ required_rubygems_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ requirements: []
131
+ rubyforge_project:
132
+ rubygems_version: 2.4.8
133
+ signing_key:
134
+ specification_version: 4
135
+ summary: A simple riot api wrapper with the aim of being easy to use and well documented.
136
+ test_files: []