giocopro 0.0.7 → 0.0.8

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.
@@ -7,8 +7,8 @@ module GiocoResource
7
7
  gioco_object.track_event(name, self.id)
8
8
  end
9
9
 
10
- def ranking
11
- gioco_object.ranking
10
+ def ranking(size=100, batch=1)
11
+ gioco_object.ranking(size, batch)
12
12
  end
13
13
 
14
14
  def gioco_object
data/lib/giocopro.rb CHANGED
@@ -22,8 +22,9 @@ 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')
25
+ def ranking(size, batch)
26
+ data = {'size' => size, 'batch' => batch}
27
+ get_data('ranking/retrieve.json', nil, data)
27
28
  end
28
29
 
29
30
  private
@@ -34,9 +35,9 @@ module Giocopro
34
35
  data
35
36
  end
36
37
 
37
- def get_data(url, aid=nil)
38
+ def get_data(url, aid=nil, data=nil)
38
39
  req = Net::HTTP::Get.new(('/api/' + url), @headers)
39
- request!(nil, aid, req)
40
+ request!(data, aid, req)
40
41
  end
41
42
 
42
43
  def post_data(url, aid, data)
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: 17
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 7
10
- version: 0.0.7
9
+ - 8
10
+ version: 0.0.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gioco Pro