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 +4 -4
- data/README.md +8 -5
- data/lib/ClashRoyale.rb +18 -13
- data/lib/ClashRoyale/version.rb +1 -1
- metadata +2 -6
- data/clashroyale-0.1.0.gem +0 -0
- data/clashroyale-1.0.0.gem +0 -0
- data/clashroyale-1.0.1.gem +0 -0
- data/clashroyale-1.0.2.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9330c37af25e363f33dd73f289064780838f2464
|
|
4
|
+
data.tar.gz: e6b88b4117a4f715725b8709dbe27da04550530e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd69d6f3daf86508d8ee04dce06d5e64bd409b0428ea44b8c44c906a7c7ca780c7e4469f106fd93d6397bf2b367e2aab58eb054f171ffb2ef86a90d7e2681802
|
|
7
|
+
data.tar.gz: aab4a10dab3b30b313a8f3e25bb28d58f3dbe57212b5bafd3288b210deb56fdab833491003b9b2fc728737c849cc62240d038b1275454aef67ed9877ac1a543a
|
data/README.md
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
# Clash Royale Ruby Gem
|
|
2
|
-
|
|
3
|
-

|
|
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
|
|
data/lib/ClashRoyale.rb
CHANGED
|
@@ -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
|
-
|
|
7
|
+
end
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
# Deck class
|
|
10
|
+
class Chashdata
|
|
11
|
+
include Clashroyale
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
17
|
-
|
|
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
|
-
|
|
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
|
data/lib/ClashRoyale/version.rb
CHANGED
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:
|
|
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-
|
|
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: ''
|
data/clashroyale-0.1.0.gem
DELETED
|
Binary file
|
data/clashroyale-1.0.0.gem
DELETED
|
Binary file
|
data/clashroyale-1.0.1.gem
DELETED
|
Binary file
|
data/clashroyale-1.0.2.gem
DELETED
|
Binary file
|