Class: Squall::Role
Overview
OnApp Role
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary (collapse)
-
- (Object) create(options = {})
Create a new Role.
-
- (Object) delete(id)
Delete a Role.
-
- (Object) edit(id, options = {})
Edit a Role.
-
- (Object) list
Lists all roles.
-
- (Object) permissions
Lists all permissions available.
-
- (Object) show(id)
Show info for the given role.
Methods inherited from Base
#check_config, #default_params, #key_for_class, #request
Instance Method Details
- (Object) create(options = {})
Create a new Role
31 32 33 |
# File 'lib/squall/role.rb', line 31 def create( = {}) request(:post, '/roles.json', default_params()) end |
- (Object) delete(id)
Delete a Role.
54 55 56 |
# File 'lib/squall/role.rb', line 54 def delete(id) request(:delete, "/roles/#{id}.json") end |
- (Object) edit(id, options = {})
Edit a Role.
45 46 47 |
# File 'lib/squall/role.rb', line 45 def edit(id, = {}) request(:put, "/roles/#{id}.json", default_params()) end |
- (Object) list
Lists all roles.
7 8 9 10 |
# File 'lib/squall/role.rb', line 7 def list response = request(:get, '/roles.json') response.collect { |role| role['role']} end |
- (Object) permissions
Lists all permissions available.
61 62 63 64 |
# File 'lib/squall/role.rb', line 61 def response = request(:get, '/permissions.json') response.collect { |perm| perm['permission'] } end |
- (Object) show(id)
Show info for the given role.
17 18 19 20 |
# File 'lib/squall/role.rb', line 17 def show(id) response = request(:get, "/roles/#{id}.json") response["role"] end |