Class: Octobat::Plaza::Account
- Inherits:
-
APIResource
- Object
- OctobatObject
- APIResource
- Octobat::Plaza::Account
- Extended by:
- APIOperations::List
- Includes:
- APIOperations::Create, APIOperations::Update
- Defined in:
- lib/octobat/plaza/account.rb
Instance Attribute Summary
Attributes inherited from OctobatObject
Class Method Summary collapse
Instance Method Summary collapse
- #activate(params = {}, opts = {}) ⇒ Object
- #deactivate(params = {}, opts = {}) ⇒ Object
- #list_capabilities(params = {}, opts = {}) ⇒ Object
Methods included from APIOperations::List
Methods included from APIOperations::Update
#save, #serialize_metadata, #serialize_params
Methods included from APIOperations::Create
Methods inherited from APIResource
class_name, #refresh, retrieve, #url
Methods inherited from OctobatObject
#[], #[]=, #_dump, _load, #as_json, construct_from, #each, #initialize, #inspect, #keys, #refresh_from, #respond_to?, #to_hash, #to_json, #to_s, #values
Constructor Details
This class inherits a constructor from Octobat::OctobatObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Octobat::OctobatObject
Class Method Details
.url ⇒ Object
8 9 10 |
# File 'lib/octobat/plaza/account.rb', line 8 def self.url '/plaza/accounts' end |
Instance Method Details
#activate(params = {}, opts = {}) ⇒ Object
12 13 14 15 |
# File 'lib/octobat/plaza/account.rb', line 12 def activate(params = {}, opts = {}) response, api_key = Octobat.request(:patch, activate_url, @api_key, params, opts) refresh_from(response, api_key) end |
#deactivate(params = {}, opts = {}) ⇒ Object
17 18 19 20 |
# File 'lib/octobat/plaza/account.rb', line 17 def deactivate(params = {}, opts = {}) response, api_key = Octobat.request(:patch, deactivate_url, @api_key, params, opts) refresh_from(response, api_key) end |
#list_capabilities(params = {}, opts = {}) ⇒ Object
22 23 24 |
# File 'lib/octobat/plaza/account.rb', line 22 def list_capabilities(params = {}, opts = {}) Capability.list(params.merge({ :account => id }), {api_key: @api_key}.merge(opts)) end |