Class: Helpful::Api::Accounts
- Inherits:
-
Object
- Object
- Helpful::Api::Accounts
- Defined in:
- lib/helpful/api/accounts.rb
Overview
These are like organizations which use Helpful.
Instance Method Summary collapse
-
#all(options = {}) ⇒ Object
All the accounts the user has access to.
-
#get(account_id, options = {}) ⇒ Object
Get an account the user has access to.
-
#initialize(client) ⇒ Accounts
constructor
A new instance of Accounts.
-
#update(account_id, options = {}) ⇒ Object
Update an account the user has access to.
Constructor Details
#initialize(client) ⇒ Accounts
Returns a new instance of Accounts.
8 9 10 |
# File 'lib/helpful/api/accounts.rb', line 8 def initialize(client) @client = client end |
Instance Method Details
#all(options = {}) ⇒ Object
All the accounts the user has access to
‘/accounts’ GET
15 16 17 18 19 |
# File 'lib/helpful/api/accounts.rb', line 15 def all( = {}) body = .fetch(:query, {}) @client.get("/accounts", body, ) end |
#get(account_id, options = {}) ⇒ Object
Get an account the user has access to
‘/accounts/:account_id’ GET
account_id - Identifier of the account
26 27 28 29 30 |
# File 'lib/helpful/api/accounts.rb', line 26 def get(account_id, = {}) body = .fetch(:query, {}) @client.get("/accounts/#{account_id}", body, ) end |
#update(account_id, options = {}) ⇒ Object
Update an account the user has access to
‘/accounts/:account_id’ PATCH
account_id - Identifier of the account
37 38 39 40 41 |
# File 'lib/helpful/api/accounts.rb', line 37 def update(account_id, = {}) body = .fetch(:body, {}) @client.patch("/accounts/#{account_id}", body, ) end |