Module: Bearcat::Client::Users

Included in:
Bearcat::Client
Defined in:
lib/bearcat/client/users.rb

Instance Method Summary collapse

Instance Method Details

#add_user(account, params = {}) ⇒ Object



13
14
15
# File 'lib/bearcat/client/users.rb', line 13

def add_user(, params={})
  post("/api/v1/accounts/#{.to_s}/users", 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



39
40
41
# File 'lib/bearcat/client/users.rb', line 39

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(, params={})
  get("/api/v1/accounts/#{.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



24
25
26
# File 'lib/bearcat/client/users.rb', line 24

def load_custom_data(user, params, scope = '')
  get("/api/v1/users/#{user}/custom_data/#{scope}", 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



32
33
34
# File 'lib/bearcat/client/users.rb', line 32

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_profile(user) ⇒ Object



17
18
19
# File 'lib/bearcat/client/users.rb', line 17

def (user)
  get("/api/v1/users/#{user.to_s}/profile")
end