Class: RubyRedtail::Contact::Account
- Inherits:
-
Object
- Object
- RubyRedtail::Contact::Account
- Defined in:
- lib/ruby-redtail/contact/accounts.rb
Instance Method Summary collapse
- #assets(account_id) ⇒ Object
- #create(params) ⇒ Object
- #fetch ⇒ Object
-
#initialize(contact_id, account_id, api_hash) ⇒ Account
constructor
A new instance of Account.
- #update(account_id, params) ⇒ Object
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, account_id, api_hash) @api_hash = api_hash @contact_id = contact_id @account_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 (account_id) RubyRedtail::Query.run("contacts/#{@contact_id}/#{account_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 |
#fetch ⇒ Object
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 (account_id, params) RubyRedtail::Query.run("contacts/#{@contact_id}/accounts/#{account_id}", @api_hash, 'PUT', params) end |