clashroyale 1.0.3 → 2.0.4

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: 31daf95c4d8d7da03e22a7d3414355342043de41
4
- data.tar.gz: 8e4bf8801092fb16572e0b40866ace1218e0e8ab
3
+ metadata.gz: 9330c37af25e363f33dd73f289064780838f2464
4
+ data.tar.gz: e6b88b4117a4f715725b8709dbe27da04550530e
5
5
  SHA512:
6
- metadata.gz: fb3306a43c18d9bb179a0953be6a80a15f6251c46ee7d2632607f6408f7d1b0daabf67c99844ac7a39f5deac62d1a4388f70f25320abcff5e58be9ab3cb9dd64
7
- data.tar.gz: d333b8a4e47c4ce8babfbaea48267eee85de35000ed82902512df02aabced7b623f1a8782ba85d1c4f99a1d244dd95824e66751653ccc8813c6c399c11779660
6
+ metadata.gz: dd69d6f3daf86508d8ee04dce06d5e64bd409b0428ea44b8c44c906a7c7ca780c7e4469f106fd93d6397bf2b367e2aab58eb054f171ffb2ef86a90d7e2681802
7
+ data.tar.gz: aab4a10dab3b30b313a8f3e25bb28d58f3dbe57212b5bafd3288b210deb56fdab833491003b9b2fc728737c849cc62240d038b1275454aef67ed9877ac1a543a
data/README.md CHANGED
@@ -1,11 +1,7 @@
1
- # Clash Royale Ruby Gem
2
-
3
- ![alt tag](http://clashroyalearena.com/wp-content/uploads/2016/08/eltOwBn.jpg)
1
+ # Clash Royale Ruby Gem to connect to martincarrera's clash-royale-api https://github.com/martincarrera/clash-royale-api
4
2
 
5
3
  ## Installation
6
4
 
7
- Add this line to your application's Gemfile:
8
-
9
5
  ```ruby
10
6
  gem 'clashroyale'
11
7
  ```
@@ -21,6 +17,13 @@ Or install it yourself as:
21
17
  ## Usage
22
18
 
23
19
  Use this gem to get a inteface with Clash Royale API
20
+ ```ruby
21
+ clashdata = Deck.new
22
+ clashdata.cards #Retrives a array of All Cards
23
+ clashdata.chests #Retrives a array of All Cards
24
+ clashdata.arenas #Retrives a array of All Cards
25
+ clashdata.players #Retrives a array of All Cards
26
+ ```
24
27
 
25
28
  ## Development
26
29
 
@@ -1,24 +1,29 @@
1
1
  require 'clashroyale/version'
2
2
  require 'httparty'
3
- #
3
+
4
+ # Top module
4
5
  module Clashroyale
5
6
  include HTTParty
6
- base_uri 'http://www.clashapi.xyz'
7
+ end
7
8
 
8
- def self.cards
9
- get("#{base_uri}/api/cards", format: :json).parsed_response
10
- end
9
+ # Deck class
10
+ class Chashdata
11
+ include Clashroyale
11
12
 
12
- def self.arenas
13
- get("#{base_uri}/api/arenas", format: :json).parsed_response
14
- end
13
+ attr_accessor :cards, :arenas, :chests, :players
14
+ # base_uri = 'http://www.clashapi.xyz'
15
+ # that hash has 4 others hashes
15
16
 
16
- def self.chests
17
- get("#{base_uri}/api/chests", format: :json).parsed_response
17
+ def initialize
18
+ self.players = fetch('players')
19
+ self.chests = fetch('chests')
20
+ self.arenas = fetch('arenas')
21
+ self.cards = fetch('cards')
18
22
  end
19
23
 
20
- def self.players
21
- get("#{base_uri}/api/players", format: :json).parsed_response
22
- end
24
+ private
23
25
 
26
+ def fetch(type)
27
+ HTTParty.get("http://www.clashapi.xyz/api/#{type}", format: :json).parsed_response
28
+ end
24
29
  end
@@ -1,3 +1,3 @@
1
1
  module Clashroyale
2
- VERSION = "1.0.3"
2
+ VERSION = "2.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clashroyale
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anderson da silva lima
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-28 00:00:00.000000000 Z
11
+ date: 2017-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -85,10 +85,6 @@ files:
85
85
  - Rakefile
86
86
  - bin/console
87
87
  - bin/setup
88
- - clashroyale-0.1.0.gem
89
- - clashroyale-1.0.0.gem
90
- - clashroyale-1.0.1.gem
91
- - clashroyale-1.0.2.gem
92
88
  - lib/ClashRoyale.rb
93
89
  - lib/ClashRoyale/version.rb
94
90
  homepage: ''
Binary file
Binary file
Binary file
Binary file