Module: Bearcat::Client::Users
- Included in:
- Bearcat::Client
- Defined in:
- lib/bearcat/client/users.rb
Instance Method Summary collapse
- #add_user(account, params = {}) ⇒ Object
- #communication_channels(user, params = {}) ⇒ Object
-
#delete_custom_data(user, params, scope = '') ⇒ Object
scope: food params: ‘com.account-domain.canvas-app’ deletes all custom user data for the food scope.
- #list_users(account, params = {}) ⇒ Object
-
#load_custom_data(user, params, scope = '') ⇒ Object
scope: food params: ‘com.account-domain.canvas-app’ returns all custom user food scope data.
- #page_views(user, params = {}) ⇒ Object
-
#store_custom_data(user, params, scope = '') ⇒ Object
scope: food params: ‘com.account-domain.canvas-app’, data: {‘favorite’ => ‘steak’, ‘least favorite’ => ‘water mellon’} stores custom data in the food scope.
- #user_avatars(user, params = {}) ⇒ Object
- #user_logins(user, params = {}) ⇒ Object
- #user_merge(user, merge_into_user) ⇒ Object
- #user_profile(user, params = {}) ⇒ Object
Instance Method Details
#add_user(account, params = {}) ⇒ Object
13 14 15 |
# File 'lib/bearcat/client/users.rb', line 13 def add_user(account, params={}) post("/api/v1/accounts/#{account.to_s}/users", params) end |
#communication_channels(user, params = {}) ⇒ Object
25 26 27 |
# File 'lib/bearcat/client/users.rb', line 25 def communication_channels(user, params={}) get("/api/v1/users/#{user.to_s}/communication_channels", params) end |
#delete_custom_data(user, params, scope = '') ⇒ Object
scope: food params: ‘com.account-domain.canvas-app’ deletes all custom user data for the food scope. If no scope deletes all custom user data
47 48 49 |
# File 'lib/bearcat/client/users.rb', line 47 def delete_custom_data(user, params, scope = '') delete("/api/v1/users/#{user}/custom_data/#{scope}", params) end |
#list_users(account, params = {}) ⇒ Object
5 6 7 |
# File 'lib/bearcat/client/users.rb', line 5 def list_users(account, params={}) get("/api/v1/accounts/#{account.to_s}/users", params) end |
#load_custom_data(user, params, scope = '') ⇒ Object
scope: food params: ‘com.account-domain.canvas-app’ returns all custom user food scope data. If no scope returns all custom user data
32 33 34 |
# File 'lib/bearcat/client/users.rb', line 32 def load_custom_data(user, params, scope = '') get("/api/v1/users/#{user}/custom_data/#{scope}", params) end |
#page_views(user, params = {}) ⇒ Object
51 52 53 |
# File 'lib/bearcat/client/users.rb', line 51 def page_views(user, params = {}) get("/api/v1/users/#{user}/page_views", params) end |
#store_custom_data(user, params, scope = '') ⇒ Object
scope: food params: ‘com.account-domain.canvas-app’,
data: {'favorite' => 'steak', 'least favorite' => 'water mellon'}
stores custom data in the food scope
40 41 42 |
# File 'lib/bearcat/client/users.rb', line 40 def store_custom_data(user, params, scope = '') put("/api/v1/users/#{user}/custom_data/#{scope}", params) end |
#user_avatars(user, params = {}) ⇒ Object
9 10 11 |
# File 'lib/bearcat/client/users.rb', line 9 def user_avatars(user, params={}) get("/api/v1/users/#{user.to_s}/avatars", params) end |
#user_logins(user, params = {}) ⇒ Object
21 22 23 |
# File 'lib/bearcat/client/users.rb', line 21 def user_logins(user, params={}) get("/api/v1/users/#{user.to_s}/logins", params) end |
#user_merge(user, merge_into_user) ⇒ Object
55 56 57 |
# File 'lib/bearcat/client/users.rb', line 55 def user_merge(user, merge_into_user) put("/api/v1/users/#{user}/merge_into/#{merge_into_user}") end |
#user_profile(user, params = {}) ⇒ Object
17 18 19 |
# File 'lib/bearcat/client/users.rb', line 17 def user_profile(user, params={}) get("/api/v1/users/#{user.to_s}/profile", params) end |