Class: Squall::Whitelist
Overview
OnApp Whitelist
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (Object) create(user_id, options = {})
Create a whitelist for a user.
-
- (Object) delete(user_id, id)
Delete a whitelist.
-
- (Object) edit(user_id, id, options = {})
Edit a whitelist.
-
- (Object) list(user_id)
Lists all whitelists.
-
- (Object) show(user_id, id)
Get the details for a whitelist.
Methods inherited from Base
#check_config, #default_params, #key_for_class, #request
Instance Method Details
- (Object) create(user_id, options = {})
Create a whitelist for a user.
38 39 40 |
# File 'lib/squall/whitelist.rb', line 38 def create(user_id, = {}) request(:post, "/users/#{user_id}/user_white_lists.json", query: { user_white_list: }) end |
- (Object) delete(user_id, id)
Delete a whitelist.
59 60 61 |
# File 'lib/squall/whitelist.rb', line 59 def delete(user_id, id) request(:delete, "/users/#{user_id}/user_white_lists/#{id}.json") end |
- (Object) edit(user_id, id, options = {})
Edit a whitelist.
49 50 51 |
# File 'lib/squall/whitelist.rb', line 49 def edit(user_id, id, = {}) request(:put, "/users/#{user_id}/user_white_lists/#{id}.json", query: { user_white_list: }) end |
- (Object) list(user_id)
Lists all whitelists.
9 10 11 12 |
# File 'lib/squall/whitelist.rb', line 9 def list(user_id) response = request(:get, "/users/#{user_id}/user_white_lists.json") response.collect { |user| user['user_white_list'] } end |
- (Object) show(user_id, id)
Get the details for a whitelist.
20 21 22 23 |
# File 'lib/squall/whitelist.rb', line 20 def show(user_id, id) response = request(:get, "/users/#{user_id}/user_white_lists/#{id}.json") response['user_white_list'] end |