sightstone 0.2.1 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99183bf85100d46a45520091b1051982463a588d
4
- data.tar.gz: 5d00fdc61114ddac8017d9e83390124bc72ced7f
3
+ metadata.gz: f116214f33400d4753fc864706fbeb8ec8da2b2c
4
+ data.tar.gz: 15eadac3ff6f1e9429ea9a82dda928b53c2beb51
5
5
  SHA512:
6
- metadata.gz: 0e54d154007fd08f640cd597d03d73ea2b20d17b878bd39e39d6309935817ac35bc63a7be23c833aa1b74d47987c504a0c9bcb1e50400e9a6fdf12f2ad7a4e97
7
- data.tar.gz: 043e21dd8bd65b02baef3d5c3554afebcfc74ca9e07d07a7b13f09a42733ec2e2a049732c0904f8690b009500c5512f82e5b64ba2cdc7720c9412ee7ac421d09
6
+ metadata.gz: 04d66bd583fdbf2390f82a8ced8f874eb6a3251078b756d35b119a4ab3dcac01880be6692067fda38318c577630188eb38142f2855c53b58f686715bf3cb6580
7
+ data.tar.gz: 9bb9f4c21fe1f406e5815c1ff0348df8e3cafab35d61d076bb8634f4f6c9e4308e925c80a7ea5ff43e4d2cb007bbdb7a0d13c24cfa1113bf934da660a5f1e601
data/lib/sightstone.rb CHANGED
@@ -6,7 +6,7 @@ require 'sightstone/modules/game_module'
6
6
  require 'sightstone/modules/league_module'
7
7
  require 'sightstone/modules/stats_module'
8
8
  require 'sightstone/modules/team_module'
9
- #require 'sightstone/modules/datadragon_module'
9
+ require 'sightstone/modules/datadragon_module'
10
10
 
11
11
  # This is the main class of the Sightstone gem. All calls should be perfomrmed through this class.
12
12
  # @attr [String] region The default region
@@ -21,7 +21,7 @@ class Sightstone
21
21
 
22
22
  attr_accessor :region
23
23
  attr_accessor :api_key
24
- attr_accessor :summoner, :champion, :game, :league, :stats, :team
24
+ attr_accessor :summoner, :champion, :game, :league, :stats, :team, :ddragon
25
25
 
26
26
  # @param api_key [String] Riot developer api key
27
27
  # @param region [String] The default region to be used. See riots dev. page for supported regions.
@@ -35,6 +35,7 @@ class Sightstone
35
35
  @league = LeagueModule.new(self)
36
36
  @stats = StatsModule.new(self)
37
37
  @team = TeamModule.new(self)
38
+ @ddragon = DatadragonModule.new(self)
38
39
  end
39
40
  end
40
41
 
@@ -0,0 +1,21 @@
1
+ require 'sightstone/modules/sightstone_base_module'
2
+
3
+ class DatadragonModule < SightstoneBaseModule
4
+
5
+ def initialize(sightstone)
6
+ @sightstone = sightstone
7
+ end
8
+
9
+ def version(optional={})
10
+ region = optional[:region] || @sightstone.region
11
+ uri = "http://ddragon.leagueoflegends.com/realms/#{region}.json"
12
+
13
+ response = _get_api_response(uri)
14
+ _parse_response(response) { |resp|
15
+ data = JSON.parse(resp)
16
+ return data['v']
17
+ }
18
+ end
19
+
20
+
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sightstone
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bauer
@@ -49,6 +49,7 @@ files:
49
49
  - lib/sightstone/masterybook.rb
50
50
  - lib/sightstone/match_history.rb
51
51
  - lib/sightstone/modules/champion_module.rb
52
+ - lib/sightstone/modules/datadragon_module.rb
52
53
  - lib/sightstone/modules/game_module.rb
53
54
  - lib/sightstone/modules/league_module.rb
54
55
  - lib/sightstone/modules/sightstone_base_module.rb