Class: RubyRedtail::Contact::Account

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

Instance Method Summary collapse

Constructor Details

#initialize(contact_id, account_id, api_hash) ⇒ Account

Returns a new instance of Account.



4
5
6
7
8
# File 'lib/ruby-redtail/contact/accounts.rb', line 4

def initialize(contact_id, , api_hash)
  @api_hash = api_hash
  @contact_id = contact_id
  @account_id = 
end

Instance Method Details

#assets(account_id) ⇒ Object



22
23
24
# File 'lib/ruby-redtail/contact/accounts.rb', line 22

def assets ()
  RubyRedtail::Query.run("contacts/#{@contact_id}/#{}/assets", @api_hash, "GET")
end

#create(params) ⇒ Object



14
15
16
# File 'lib/ruby-redtail/contact/accounts.rb', line 14

def create (params)
  update(@contact_id, 0, params)
end

#fetchObject



10
11
12
# File 'lib/ruby-redtail/contact/accounts.rb', line 10

def fetch
  RubyRedtail::Query.run("contacts/#{@contact_id}/accounts", @api_hash, "GET")
end

#update(account_id, params) ⇒ Object



18
19
20
# File 'lib/ruby-redtail/contact/accounts.rb', line 18

def update (, params)
  RubyRedtail::Query.run("contacts/#{@contact_id}/accounts/#{}", @api_hash, 'PUT', params)
end