Module: Checkdin::Users
- Included in:
- Client
- Defined in:
- lib/checkdin/users.rb
Instance Method Summary collapse
-
#create_user(options = {}) ⇒ Object
Create a user in the checkd.in system tied to the authenticating client.
-
#create_user_authentication(id, options = {}) ⇒ Object
Create an authentication for a user.
-
#user(id) ⇒ Object
Retrieve information about a single user.
-
#user_authentication(user_id, id) ⇒ Object
Retrieve information about a user’s specific authentication to an external service.
-
#user_authentications(id) ⇒ Object
Retrieve a list of a user’s authentications to external services (Facebook, Foursquare, etc.).
-
#users(options = {}) ⇒ Object
Get a list of all users for the authenticating client.
-
#whitelabel_user_lookup(id) ⇒ Object
Lookup the checkd.in ID of a user based on their whitelabel ID.
Instance Method Details
#create_user(options = {}) ⇒ Object
Create a user in the checkd.in system tied to the authenticating client.
40 41 42 43 44 45 |
# File 'lib/checkdin/users.rb', line 40 def create_user(={}) response = connection.post do |req| req.url "users", end return_error_or_body(response) end |
#create_user_authentication(id, options = {}) ⇒ Object
Create an authentication for a user
param [Integer] id The ID of the user
76 77 78 79 80 81 |
# File 'lib/checkdin/users.rb', line 76 def create_user_authentication(id, ={}) response = connection.post do |req| req.url "users/#{id}/authentications", end return_error_or_body(response) end |
#user(id) ⇒ Object
Retrieve information about a single user
param [Integer] id The ID of the user
8 9 10 11 |
# File 'lib/checkdin/users.rb', line 8 def user(id) response = connection.get("users/#{id}") return_error_or_body(response) end |
#user_authentication(user_id, id) ⇒ Object
Retrieve information about a user’s specific authentication to an external service
param [Integer] user_id The ID of the user param [Integer] id The ID of the authentication
61 62 63 64 |
# File 'lib/checkdin/users.rb', line 61 def user_authentication(user_id, id) response = connection.get("users/#{user_id}/authentications/#{id}") return_error_or_body(response) end |
#user_authentications(id) ⇒ Object
Retrieve a list of a user’s authentications to external services (Facebook, Foursquare, etc.)
param [Integer] id The ID of the user
51 52 53 54 |
# File 'lib/checkdin/users.rb', line 51 def user_authentications(id) response = connection.get("users/#{id}/authentications") return_error_or_body(response) end |
#users(options = {}) ⇒ Object
Get a list of all users for the authenticating client.
18 19 20 21 22 23 |
# File 'lib/checkdin/users.rb', line 18 def users(={}) response = connection.get do |req| req.url "users", end return_error_or_body(response) end |
#whitelabel_user_lookup(id) ⇒ Object
Lookup the checkd.in ID of a user based on their whitelabel ID.
params [Integer] id The whitelabel identifier of the user (passed to checkd.in during creation)
29 30 31 32 |
# File 'lib/checkdin/users.rb', line 29 def whitelabel_user_lookup(id) response = connection.get("users/whitelabel/#{id}") return_error_or_body(response) end |