the_nexus 0.0.2 → 0.0.3

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: eb439f424152462afc6a177b9664bedb5349bc0b
4
- data.tar.gz: 9403e1a32bd41329b9109f2bb4e1adf7d42e9644
3
+ metadata.gz: dd5052c1db5e4f6d0eff8b7dbfe395cf6a15f085
4
+ data.tar.gz: 80a74445c29d6902d2003052113dff18e1555fa1
5
5
  SHA512:
6
- metadata.gz: f123964168d2cf36c83666901597db8cf5a5703d74fc5c4204106cf67283fd2ee505ae006da6247354e21e1b626b76d89c6059f0b9c8d73a515e46984846ce1f
7
- data.tar.gz: 7c8dd39be9d6f513110eb8fc862cc7b7bc4ecb676661194eeb1a52f228cd94b6a25106c9ea39a50a3c88d1c71a988dfee95c991938708707b8e63dbfb6d72587
6
+ metadata.gz: eb8e93d4dcbc8fbedd0aa6cdcf1bbc539b96391cf3d33002bd660f586128a967fb659bd6bed4e2ad3931b1c9d7af18f3692b4164c0a8c0f5d9fadaaebaa1fc4a
7
+ data.tar.gz: 90f7ebfae3cb32d7f0be0cb8ae878039c8f02ce69836f8d519b2661312385cc13915cee1a6ee5b62306efc2bf3eac4c928407c870bc7710362399bcb2e85743e
data/lib/nexus.rb CHANGED
@@ -1,74 +1,16 @@
1
1
  require "httparty"
2
- require '../lib/nexus/summoner'
3
- require '../lib/nexus/static'
4
- require '../lib/nexus/model/models'
5
2
 
6
- module Nexus
7
- include HTTParty
3
+ #Basic Connection#
4
+ require_relative 'nexus/connection'
8
5
 
9
- attr_accessor :api_key
10
- attr_accessor :uri
11
- attr_accessor :region
6
+ #Controllers#
7
+ require_relative 'nexus/controller/summoner'
8
+ require_relative 'nexus/controller/static'
12
9
 
13
- def self.api_key(api_key)
14
- @api_key = api_key.to_s
15
- end
10
+ #Models#
11
+ require_relative 'nexus/model/summoner'
12
+ require_relative 'nexus/model/champion'
13
+ require_relative 'nexus/model/masteries'
14
+ require_relative 'nexus/model/items'
15
+ require_relative 'nexus/model/runes'
16
16
 
17
- def self.connect_to(region)
18
- case region.to_s.downcase
19
-
20
- when "eune", "eu nordic & east", "eu nordic and east"
21
- @uri = "https://eune.api.pvp.net/api/lol/eune/"
22
- @region = "eune"
23
-
24
- when "euw", "eu west"
25
- @uri = "https://euw.api.pvp.net/api/lol/euw/"
26
- @region = "euw"
27
-
28
- when "kr", "korea"
29
- @uri = "https://kr.api.pvp.net/api/lol/kr/"
30
- @region = "kr"
31
-
32
- when "br", "brasil", "brazil"
33
- @uri = "https://br.api.pvp.net/api/lol/br/"
34
- @region = "br"
35
-
36
- when "lan", "latin america north"
37
- @uri = "https://lan.api.pvp.net/api/lol/lan/"
38
- @region = "lan"
39
-
40
- when "las", "latin america south"
41
- @uri = "https://las.api.pvp.net/api/lol/las/"
42
- @region = "las"
43
-
44
- when "na", "north america"
45
- @uri = "https://na.api.pvp.net/api/lol/na/"
46
- @region = "na"
47
-
48
- when "oce", "oceania"
49
- @uri = "https://oce.api.pvp.net/api/lol/oce/"
50
- @region = "oce"
51
-
52
- when "ru", "russia"
53
- @uri = "https://ru.api.pvp.net/api/lol/ru/"
54
- @region = "ru"
55
-
56
- when "tr", "turkey"
57
- @uri = "https://tr.api.pvp.net/api/lol/tr/"
58
- @region = "tr"
59
-
60
- else
61
- nil
62
-
63
- end
64
- end
65
-
66
- private
67
- def self.retrieve_url_ident(response, ident)
68
- response.parsed_response["#{ident.to_s.downcase}"]
69
- end
70
-
71
- def self.retrieve_url(response)
72
- response.parsed_response
73
- end
74
- end
@@ -0,0 +1,69 @@
1
+ module Nexus
2
+ include HTTParty
3
+
4
+ attr_accessor :api_key
5
+ attr_accessor :uri
6
+ attr_accessor :region
7
+
8
+ def self.api_key(api_key)
9
+ @api_key = api_key.to_s
10
+ end
11
+
12
+ def self.connect_to(region)
13
+ case region.to_s.downcase
14
+
15
+ when "eune", "eu nordic & east", "eu nordic and east"
16
+ @uri = "https://eune.api.pvp.net/api/lol/eune/"
17
+ @region = "eune"
18
+
19
+ when "euw", "eu west"
20
+ @uri = "https://euw.api.pvp.net/api/lol/euw/"
21
+ @region = "euw"
22
+
23
+ when "kr", "korea"
24
+ @uri = "https://kr.api.pvp.net/api/lol/kr/"
25
+ @region = "kr"
26
+
27
+ when "br", "brasil", "brazil"
28
+ @uri = "https://br.api.pvp.net/api/lol/br/"
29
+ @region = "br"
30
+
31
+ when "lan", "latin america north"
32
+ @uri = "https://lan.api.pvp.net/api/lol/lan/"
33
+ @region = "lan"
34
+
35
+ when "las", "latin america south"
36
+ @uri = "https://las.api.pvp.net/api/lol/las/"
37
+ @region = "las"
38
+
39
+ when "na", "north america"
40
+ @uri = "https://na.api.pvp.net/api/lol/na/"
41
+ @region = "na"
42
+
43
+ when "oce", "oceania"
44
+ @uri = "https://oce.api.pvp.net/api/lol/oce/"
45
+ @region = "oce"
46
+
47
+ when "ru", "russia"
48
+ @uri = "https://ru.api.pvp.net/api/lol/ru/"
49
+ @region = "ru"
50
+
51
+ when "tr", "turkey"
52
+ @uri = "https://tr.api.pvp.net/api/lol/tr/"
53
+ @region = "tr"
54
+
55
+ else
56
+ nil
57
+
58
+ end
59
+ end
60
+
61
+ private
62
+ def self.retrieve_url_ident(response, ident)
63
+ response.parsed_response["#{ident.to_s.downcase}"]
64
+ end
65
+
66
+ def self.retrieve_url(response)
67
+ response.parsed_response
68
+ end
69
+ end
File without changes
File without changes
data/lib/nexus/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Nexus
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: the_nexus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gui Carneiro
@@ -65,14 +65,14 @@ files:
65
65
  - README.md
66
66
  - Rakefile
67
67
  - lib/nexus.rb
68
+ - lib/nexus/connection.rb
69
+ - lib/nexus/controller/static.rb
70
+ - lib/nexus/controller/summoner.rb
68
71
  - lib/nexus/model/champion.rb
69
72
  - lib/nexus/model/items.rb
70
73
  - lib/nexus/model/masteries.rb
71
- - lib/nexus/model/models.rb
72
74
  - lib/nexus/model/runes.rb
73
75
  - lib/nexus/model/summoner.rb
74
- - lib/nexus/static.rb
75
- - lib/nexus/summoner.rb
76
76
  - lib/nexus/version.rb
77
77
  - nexus.gemspec
78
78
  homepage: https://github.com/GuiCarneiro/Nexus
@@ -1,5 +0,0 @@
1
- require "../lib/nexus/model/summoner"
2
- require "../lib/nexus/model/runes"
3
- require "../lib/nexus/model/masteries"
4
- require "../lib/nexus/model/items"
5
- require "../lib/nexus/model/champion"