unloq 0.0.5 → 0.0.6
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/lib/unloq.rb +1 -0
- data/lib/unloq/activity.rb +16 -0
- data/lib/unloq/client.rb +3 -2
- data/lib/unloq/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef208bca1a7f91409bdb2eb3850d40f150cbedf9
|
4
|
+
data.tar.gz: fb6187958dd35a8a819c36759a3e8f9617c13f6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3aaed9b99d885f3f58cc30fcd5da125d54932493b7dea929c1602d430285ad5eafa11ebcb8b717884a8054dcc09c07dd922b476e92aa047195321e9cc664e26
|
7
|
+
data.tar.gz: 32df4ec19e6d91e3dfdf4410038a25c1e6f888b0ec2baf468005b81a569e48fc48df0671498b904e36d165b5be6b15ad26e0e1223eff16d67116bed63c3aaa70
|
data/lib/unloq.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
module Unloq
|
2
|
+
module Activity
|
3
|
+
|
4
|
+
# Fetch activity for an author or author type
|
5
|
+
#
|
6
|
+
# @param author [Unloq::Entity] The author for which to fetch activity.
|
7
|
+
# @param limit [Integer] The limit of number of records to return, defaults to 10.
|
8
|
+
|
9
|
+
def activity author, limit: 10
|
10
|
+
validate_author(author)
|
11
|
+
|
12
|
+
get('/activity', "/#{author.type}/#{author.id}", additional_options: { limit: limit })
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
data/lib/unloq/client.rb
CHANGED
@@ -5,6 +5,7 @@ module Unloq
|
|
5
5
|
include Achievements
|
6
6
|
include Scoreboards
|
7
7
|
include Ratings
|
8
|
+
include Activity
|
8
9
|
|
9
10
|
attr_reader :api_key, :namespace
|
10
11
|
|
@@ -43,10 +44,10 @@ module Unloq
|
|
43
44
|
# @param base_endpoint [String] The base resource endpoint, e.g. /events
|
44
45
|
# @param resource_scope [String] The scope of the resource endpoint, e.g. /User/1/login/User/1
|
45
46
|
|
46
|
-
def get base_endpoint, resource_scope = nil
|
47
|
+
def get base_endpoint, resource_scope = nil, additional_options: {}
|
47
48
|
|
48
49
|
response = connection.get do |req|
|
49
|
-
req.url "#{base_endpoint}/#{api_key}/#{namespace}#{resource_scope}"
|
50
|
+
req.url "#{base_endpoint}/#{api_key}/#{namespace}#{resource_scope}", additional_options
|
50
51
|
end
|
51
52
|
|
52
53
|
format_response_or_raise_error(response)
|
data/lib/unloq/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unloq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Mueller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -134,6 +134,7 @@ files:
|
|
134
134
|
- README.md
|
135
135
|
- lib/unloq.rb
|
136
136
|
- lib/unloq/achievements.rb
|
137
|
+
- lib/unloq/activity.rb
|
137
138
|
- lib/unloq/api_error.rb
|
138
139
|
- lib/unloq/api_error/not_found_error.rb
|
139
140
|
- lib/unloq/client.rb
|