unloq 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cff86a832993541cd2daceb983e0815d0ce04a85
4
- data.tar.gz: a932aafed57edd407713b2facd08dace8d84d6bf
3
+ metadata.gz: ef208bca1a7f91409bdb2eb3850d40f150cbedf9
4
+ data.tar.gz: fb6187958dd35a8a819c36759a3e8f9617c13f6a
5
5
  SHA512:
6
- metadata.gz: 86dc513b6731813b6da1442614dddfe27a186f66842d92d1cbf50104417a4c235dbf4fdb8e449cd2ee4dc62c12480c90f921dc7753b7d70334a588353db43e88
7
- data.tar.gz: 511da23076ac5d92ee3c050a963e7e856887f3684ca7f62a77abb3d944edfd3fbcf0c9e869d36fe244ad12675d8e8eaa52053abda25c6d9eff3a739f8e4bc6cc
6
+ metadata.gz: e3aaed9b99d885f3f58cc30fcd5da125d54932493b7dea929c1602d430285ad5eafa11ebcb8b717884a8054dcc09c07dd922b476e92aa047195321e9cc664e26
7
+ data.tar.gz: 32df4ec19e6d91e3dfdf4410038a25c1e6f888b0ec2baf468005b81a569e48fc48df0671498b904e36d165b5be6b15ad26e0e1223eff16d67116bed63c3aaa70
@@ -13,4 +13,5 @@ require 'unloq/events'
13
13
  require 'unloq/achievements'
14
14
  require 'unloq/scoreboards'
15
15
  require 'unloq/ratings'
16
+ require 'unloq/activity'
16
17
  require 'unloq/client'
@@ -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
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module Unloq
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
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.5
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-08-25 00:00:00.000000000 Z
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