sightstone 0.4.0 → 0.4.1

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: e1ae542a57feb0c02b9c0edda4af3f15c12efc3e
4
- data.tar.gz: 8190b20a31a41ed7049b5c61117abe922efa4822
3
+ metadata.gz: a14fd5b00ace824df9ad9774ec2fb36c318d790a
4
+ data.tar.gz: 973d2381f2b9e1037b40cfdfb9496fe91c384888
5
5
  SHA512:
6
- metadata.gz: d1ff572e25f88aad085f6ba142e851511b44af196830ed2d8271c0d51d9af49ced9c3119d2501ab4670f5a8c1541d52e611e2874fb1ebb68f484776ccadb2d39
7
- data.tar.gz: 1e3c54e978dbbea24cd2fef83aaf34d561f0682a9817aa112940c04f8a2e6fcd407443d60d6ac53372d38632bca6ef405eaf471984e6faa3cb6651990c630840
6
+ metadata.gz: 69e19754eaf85ee74b5d6c468baa67940f1773413fe7bb7a6e5eacf77b54955ef52f6edc2b0d8af7d41dc2568c4cb3090999b7f7f3acd4a4cf14193885301fa7
7
+ data.tar.gz: 487e0f66303a84faa1a3a5dcc59542c1f967747c254744c2f1a95e546112eb9d933951405247d064315c9fb67412761929a472ade6cd7077f4c85a1978bf2142
@@ -1,3 +1,15 @@
1
+ # Class to represent a champion
2
+ # @attr [Boolean] active determines if champion is active
3
+ # @attr [Integer] attackRank attack rank
4
+ # @attr [Boolean] botEnabled Bot enabled flag (for custom games)
5
+ # @attr [Boolean] botMmEnabled Bot Match Made enabeld flag (for Coop/AI games)
6
+ # @attr [Integer] defenseRank Champion defense rank.
7
+ # @attr [Integer] difficultyRank Champion difficulty rank.
8
+ # @attr [Boolean] freeToPlay Indicates if the champion is free to play. Free to play champions are rotated periodically.
9
+ # @attr [Fixnum] id Champion ID.
10
+ # @attr [Integer] magicRank Champion magic rank.
11
+ # @attr [String] name Champion name.
12
+ # @attr [boolean] rankedPlayEnabled Ranked play enabled flag.
1
13
  class Champion
2
14
  attr_accessor :active, :attackRank, :botEnabled, :botMmEnabled
3
15
  attr_accessor :defenseRank, :difficultyRank, :freeToPlay, :id, :magicRank, :name, :rankedPlayEnabled
@@ -1,18 +1,21 @@
1
1
  require 'sightstone/champion'
2
2
  require 'sightstone/modules/sightstone_base_module'
3
3
 
4
+ # Module to provide calls to the summoner api
4
5
  class ChampionModule < SightstoneBaseModule
5
6
 
6
7
  def initialize(sightstone)
7
8
  @sightstone = sightstone
8
9
  end
9
10
 
11
+ # call to get champions
12
+ # @param optional [Hash] optional arguments: :region => replaces default region, :free_to_play => boolean (only free to play champs if true)
13
+ # @return [Array<Champion>] array of champs
10
14
  def champions(optional={})
11
15
  region = optional[:region] || @sightstone.region
12
16
  free_to_play = optional[:free_to_play]
13
17
  uri = "https://prod.api.pvp.net/api/lol/#{region}/v1.1/champion"
14
18
  response = _get_api_response(uri, {'freeToPlay' => free_to_play})
15
- puts response
16
19
 
17
20
  _parse_response(response) { |resp|
18
21
  data = JSON.parse(resp)
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.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Bauer