impas-client 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/impas-client.rb +13 -1
- data/lib/impas-client/version.rb +1 -1
- metadata +2 -2
data/lib/impas-client.rb
CHANGED
@@ -6,7 +6,7 @@ module Impas
|
|
6
6
|
class Client
|
7
7
|
attr_accessor :api_url, :op_key
|
8
8
|
|
9
|
-
def initialize(args)
|
9
|
+
def initialize(args ={})
|
10
10
|
@api_url = (args[:api_url].nil?) ? API_URL : args[:api_url]
|
11
11
|
@op_key = args[:op_key]
|
12
12
|
|
@@ -72,5 +72,17 @@ module Impas
|
|
72
72
|
|
73
73
|
true
|
74
74
|
end
|
75
|
+
|
76
|
+
def ranking(grp_key, type = "all", limit = 10)
|
77
|
+
entry_point = "/api/ranking/#{grp_key}/#{type}/#{limit}"
|
78
|
+
res = @@conn.get entry_point
|
79
|
+
|
80
|
+
if res.status != 200
|
81
|
+
raise StandardError.new("HTTP status:#{res.status}")
|
82
|
+
end
|
83
|
+
|
84
|
+
desc = JSON.parse(res.body)
|
85
|
+
desc["description"]["ranking"]
|
86
|
+
end
|
75
87
|
end
|
76
88
|
end
|
data/lib/impas-client/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: impas-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-01-
|
12
|
+
date: 2013-01-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|