Class: Contactually::Accounts
- Inherits:
-
Object
- Object
- Contactually::Accounts
- Defined in:
- lib/contactually/accounts.rb
Instance Method Summary collapse
- #destroy(id, params = {}) ⇒ Object
- #index(params = {}) ⇒ Object
-
#initialize(master) ⇒ Accounts
constructor
A new instance of Accounts.
- #show(id, params = {}) ⇒ Object
Constructor Details
#initialize(master) ⇒ Accounts
Returns a new instance of Accounts.
4 5 6 |
# File 'lib/contactually/accounts.rb', line 4 def initialize(master) @master = master end |
Instance Method Details
#destroy(id, params = {}) ⇒ Object
18 19 20 |
# File 'lib/contactually/accounts.rb', line 18 def destroy(id, params = {}) @master.call("accounts/#{id}.json", :delete, params) end |
#index(params = {}) ⇒ Object
8 9 10 11 |
# File 'lib/contactually/accounts.rb', line 8 def index(params = {}) hash = @master.call('accounts.json', :get, params) Contactually::Utils.accounts_hash_to_objects(hash) end |
#show(id, params = {}) ⇒ Object
13 14 15 16 |
# File 'lib/contactually/accounts.rb', line 13 def show(id, params = {}) hash = @master.call("accounts/#{id}.json", :get, params) Contactually::Utils.build_account(hash) end |