Class: RubyRedtail::Contact::Accounts

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-redtail/contact/accounts.rb

Instance Method Summary collapse

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 ()
  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

#fetchObject



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 (, params)
  RubyRedtail::Query.run("contacts/#{contact_id}/accounts/#{account_id}", @api_hash, 'PUT', params)
end