lib/bearcat/client/users.rb in bearcat-0.9.5 vs lib/bearcat/client/users.rb in bearcat-0.9.6
- old
+ new
@@ -12,8 +12,30 @@
def add_user(account, params={})
post("/api/v1/accounts/#{account.to_s}/users", params)
end
+ # scope: food
+ # params: {ns: 'com.account-domain.canvas-app'}
+ # returns all custom user food scope data. If no scope returns all custom user data
+ def load_custom_data(user, params, scope = '')
+ get("/api/v1/users/#{user}/custom_data/#{scope}", params)
+ end
+
+ # scope: food
+ # params: {ns: 'com.account-domain.canvas-app',
+ # data: {'favorite' => 'steak', 'least favorite' => 'water mellon'}}
+ # stores custom data in the food scope
+ def store_custom_data(user, params, scope = '')
+ put("/api/v1/users/#{user}/custom_data/#{scope}", params)
+ end
+
+ # scope: food
+ # params: {ns: 'com.account-domain.canvas-app'}
+ # deletes all custom user data for the food scope. If no scope deletes all custom user data
+ def delete_custom_data(user, params, scope = '')
+ delete("/api/v1/users/#{user}/custom_data/#{scope}", params)
+ end
+
end
end
end