Class: Locaweb::Emailmarketing::AccountClient
- Inherits:
-
Object
- Object
- Locaweb::Emailmarketing::AccountClient
- Defined in:
- lib/locaweb-emailmarketing/clients/account_client.rb
Instance Method Summary collapse
- #all ⇒ Object
- #get(id) ⇒ Object
-
#initialize(http_request_adapter) ⇒ AccountClient
constructor
A new instance of AccountClient.
- #update(id, attributes = {}) ⇒ Object
Constructor Details
#initialize(http_request_adapter) ⇒ AccountClient
Returns a new instance of AccountClient.
4 5 6 |
# File 'lib/locaweb-emailmarketing/clients/account_client.rb', line 4 def initialize(http_request_adapter) @http_request_adapter = http_request_adapter end |
Instance Method Details
#all ⇒ Object
8 9 10 |
# File 'lib/locaweb-emailmarketing/clients/account_client.rb', line 8 def all @http_request_adapter.get "accounts" end |
#get(id) ⇒ Object
12 13 14 |
# File 'lib/locaweb-emailmarketing/clients/account_client.rb', line 12 def get(id) @http_request_adapter.get "accounts/#{id}" end |
#update(id, attributes = {}) ⇒ Object
16 17 18 19 |
# File 'lib/locaweb-emailmarketing/clients/account_client.rb', line 16 def update(id, attributes = {}) attributes.assert_required_keys(optional: [:return_path_domain]) @http_request_adapter.put "accounts/#{id}", account: attributes end |