Class: RubyRedtail::Contact::Accounts
- Inherits:
-
Object
- Object
- RubyRedtail::Contact::Accounts
- Defined in:
- lib/ruby-redtail/contact/accounts.rb
Instance Method Summary collapse
- #assets(account_id) ⇒ Object
- #create(params) ⇒ Object
- #fetch ⇒ Object
-
#initialize(contact_id, api_hash) ⇒ Accounts
constructor
A new instance of Accounts.
- #update(account_id, params) ⇒ Object
Constructor Details
#initialize(contact_id, api_hash) ⇒ Accounts
Returns a new instance of Accounts.
4 5 6 7 |
# File 'lib/ruby-redtail/contact/accounts.rb', line 4 def initialize(contact_id, api_hash) @api_hash = api_hash @contact_id = contact_id end |
Instance Method Details
#assets(account_id) ⇒ Object
21 22 23 |
# File 'lib/ruby-redtail/contact/accounts.rb', line 21 def assets (account_id) RubyRedtail::Query.run("contacts/#{contact_id}/#{account_id}/assets", @api_hash, "GET") end |
#create(params) ⇒ Object
13 14 15 |
# File 'lib/ruby-redtail/contact/accounts.rb', line 13 def create (params) update(@contact_id, 0, params) end |
#fetch ⇒ Object
9 10 11 |
# File 'lib/ruby-redtail/contact/accounts.rb', line 9 def fetch RubyRedtail::Query.run("contacts/#{@contact_id}/accounts", @api_hash, "GET") end |
#update(account_id, params) ⇒ Object
17 18 19 |
# File 'lib/ruby-redtail/contact/accounts.rb', line 17 def update (account_id, params) RubyRedtail::Query.run("contacts/#{contact_id}/accounts/#{account_id}", @api_hash, 'PUT', params) end |