giocopro 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/giocopro.rb +7 -3
- data/lib/giocopro/gioco_resource.rb +4 -0
- metadata +4 -4
data/lib/giocopro.rb
CHANGED
@@ -9,7 +9,7 @@ module Giocopro
|
|
9
9
|
@http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
10
10
|
@headers = {'Content-Type' =>'application/json', 'Token' =>(token) ? token : ENV['GIOCOPRO_TOKEN']}
|
11
11
|
if token.nil? && ENV['GIOCOPRO_TOKEN'].nil?
|
12
|
-
return true
|
12
|
+
return true
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -22,15 +22,19 @@ module Giocopro
|
|
22
22
|
post_data('track_event.json', aid, data)
|
23
23
|
end
|
24
24
|
|
25
|
+
def ranking
|
26
|
+
get_data('ranking/retrieve.json')
|
27
|
+
end
|
28
|
+
|
25
29
|
private
|
26
30
|
|
27
31
|
def resource_data(data, aid)
|
28
32
|
data ||= {}
|
29
|
-
data['resource'] = {'aid' => aid}
|
33
|
+
data['resource'] = {'aid' => aid} if aid
|
30
34
|
data
|
31
35
|
end
|
32
36
|
|
33
|
-
def get_data(url, aid)
|
37
|
+
def get_data(url, aid=nil)
|
34
38
|
req = Net::HTTP::Get.new(('/api/' + url), @headers)
|
35
39
|
request!(nil, aid, req)
|
36
40
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: giocopro
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gioco Pro
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2014-09-
|
18
|
+
date: 2014-09-29 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|