checkdin 0.3.0 → 0.3.1
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.
- data/lib/checkdin/leaderboard.rb +16 -4
- data/lib/checkdin/users.rb +19 -0
- data/lib/checkdin/version.rb +1 -1
- metadata +1 -1
data/lib/checkdin/leaderboard.rb
CHANGED
@@ -1,15 +1,27 @@
|
|
1
1
|
module Checkdin
|
2
2
|
module Leaderboard
|
3
3
|
|
4
|
-
# Get the
|
4
|
+
# Get the leading point accounts for non-campaign-specific points.
|
5
5
|
#
|
6
|
-
# param [Integer] campaign_id The ID of the campaign to fetch the leaderboard for.
|
7
6
|
# @param [Hash] options
|
8
7
|
# @option options Integer :limit - The maximum number of records to return.
|
9
8
|
|
10
|
-
def leaderboard(
|
9
|
+
def leaderboard(options={})
|
10
|
+
response = connection.get do |req|
|
11
|
+
req.url "clients/leaderboard", options
|
12
|
+
end
|
13
|
+
return_error_or_body(response)
|
14
|
+
end
|
15
|
+
|
16
|
+
# Get the leading point accounts for a single campaign'sc specific points.
|
17
|
+
#
|
18
|
+
# param [Integer] campaign_id The ID of the campaign to fetch the leaderboard for.
|
19
|
+
# @param [Hash] options
|
20
|
+
# @option options Integer :limit - The maximum number of records to return.
|
21
|
+
|
22
|
+
def campaign_leaderboard(campaign_id, options={})
|
11
23
|
response = connection.get do |req|
|
12
|
-
req.url "campaigns/#{campaign_id}/leaderboard"
|
24
|
+
req.url "campaigns/#{campaign_id}/leaderboard"
|
13
25
|
end
|
14
26
|
return_error_or_body(response)
|
15
27
|
end
|
data/lib/checkdin/users.rb
CHANGED
@@ -135,5 +135,24 @@ module Checkdin
|
|
135
135
|
return_error_or_body(response)
|
136
136
|
end
|
137
137
|
|
138
|
+
# View a full user's description
|
139
|
+
#
|
140
|
+
# param [Integer] id The ID of the user
|
141
|
+
|
142
|
+
def view_user_full_description(id)
|
143
|
+
response = connection.get do |req|
|
144
|
+
req.url "users/#{id}/full"
|
145
|
+
end
|
146
|
+
return_error_or_body(response)
|
147
|
+
end
|
148
|
+
|
149
|
+
# Get a list of a user's point accounts
|
150
|
+
#
|
151
|
+
# param [Integer] id the ID of the user
|
152
|
+
|
153
|
+
def user_point_accounts(id)
|
154
|
+
response = connection.get("users/#{id}/point_accounts")
|
155
|
+
return_error_or_body(response)
|
156
|
+
end
|
138
157
|
end
|
139
158
|
end
|
data/lib/checkdin/version.rb
CHANGED