giocopro 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 # nothing should happen
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
@@ -7,6 +7,10 @@ module GiocoResource
7
7
  gioco_object.track_event(name, self.id)
8
8
  end
9
9
 
10
+ def ranking
11
+ gioco_object.ranking
12
+ end
13
+
10
14
  def gioco_object
11
15
  Giocopro::Giocopro.new
12
16
  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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
10
- version: 0.0.6
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 00:00:00 +02:00
18
+ date: 2014-09-29 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21