Class: Syncano::Resources::ApiKey
- Defined in:
- lib/syncano/resources/api_key.rb
Overview
Api key resource
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#authorize(permission) ⇒ Syncano::Resources::Base
Wrapper for api “authorize” method.
-
#batch_authorize(batch_client, permission) ⇒ Syncano::Resources::Base
Wrapper for api “authorize” method.
-
#batch_deauthorize(batch_client, permission) ⇒ Syncano::Resources::Base
Wrapper for api “deauthorize” method.
-
#deauthorize(permission) ⇒ Syncano::Resources::Base
Wrapper for api “deauthorize” method.
-
#initialize(client, attributes = {}) ⇒ ApiKey
constructor
Overwritten constructor with initializing associated role object.
Methods inherited from Base
#[], #[]=, all, #batch, batch_create, #batch_destroy, #batch_save, #batch_update, count, create, #destroy, #destroyed?, find, #new_record?, #reload!, #save, #saved?, #update
Constructor Details
#initialize(client, attributes = {}) ⇒ ApiKey
Overwritten constructor with initializing associated role object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/syncano/resources/api_key.rb', line 8 def initialize(client, attributes = {}) super(client, attributes) if @attributes[:role].is_a?(Hash) @attributes[:role] = ::Syncano::Resources::Role.new(client, @attributes[:role]) end if @saved_attributes[:role].is_a?(Hash) @saved_attributes[:role] = ::Syncano::Resources::Role.new(client, @saved_attributes[:role]) end end |
Instance Method Details
#authorize(permission) ⇒ Syncano::Resources::Base
Wrapper for api “authorize” method
22 23 24 25 |
# File 'lib/syncano/resources/api_key.rb', line 22 def () (nil, permission: ) self end |
#batch_authorize(batch_client, permission) ⇒ Syncano::Resources::Base
Wrapper for api “authorize” method
31 32 33 34 |
# File 'lib/syncano/resources/api_key.rb', line 31 def (batch_client, ) (batch_client, permission: ) self end |
#batch_deauthorize(batch_client, permission) ⇒ Syncano::Resources::Base
Wrapper for api “deauthorize” method
48 49 50 51 |
# File 'lib/syncano/resources/api_key.rb', line 48 def (batch_client, ) (batch_client, permission: ) self end |
#deauthorize(permission) ⇒ Syncano::Resources::Base
Wrapper for api “deauthorize” method
39 40 41 42 |
# File 'lib/syncano/resources/api_key.rb', line 39 def () (nil, permission: ) self end |