class RubyRedtail::Addresses

Public Class Methods

new(api_hash) click to toggle source
# File lib/ruby-redtail/contact/addresses.rb, line 4
def initialize(api_hash)
  @api_hash = api_hash
end

Public Instance Methods

assets_and_liabilities(contact_id) click to toggle source

Fetch Assets and Liabilities

# File lib/ruby-redtail/contact/addresses.rb, line 69
def assets_and_liabilities (contact_id)
  RubyRedtail::Query.run("contacts/#{contact_id}/assets-liabilities", @api_hash, "GET")
end
create(contact_id, params) click to toggle source

Create New Address

# File lib/ruby-redtail/contact/addresses.rb, line 19
def create (contact_id, params)
  update(contact_id, 0, params)
end
create_internet_address(contact_id, params) click to toggle source

Create New Internet Address

# File lib/ruby-redtail/contact/addresses.rb, line 59
def create_internet_address (contact_id, params)
  update_internet_address(contact_id, 0, params)
end
create_phone(contact_id, params) click to toggle source

Create New Phone

# File lib/ruby-redtail/contact/addresses.rb, line 39
def create_phone (contact_id, params)
  update(contact_id, 0, params)
end
delete(contact_id, address_id) click to toggle source

Delete Address

# File lib/ruby-redtail/contact/addresses.rb, line 24
def delete (contact_id, address_id)
  RubyRedtail::Query.run("contacts/#{contact_id}/addresses/#{address_id}", @api_hash, 'DELETE')
end
delete_internet_address(contact_id, internet_id) click to toggle source

Delete Internet Address

# File lib/ruby-redtail/contact/addresses.rb, line 64
def delete_internet_address (contact_id, internet_id)
  RubyRedtail::Query.run("contacts/#{contact_id}/phones/#{internet_id}", @api_hash, 'DELETE')
end
delete_phone(contact_id, phone_id) click to toggle source

Delete Phone

# File lib/ruby-redtail/contact/addresses.rb, line 44
def delete_phone (contact_id, phone_id)
  RubyRedtail::Query.run("contacts/#{contact_id}/phones/#{phone_id}", @api_hash, 'DELETE')
end
fetch(contact_id) click to toggle source

Fetch Address By Contact Id

# File lib/ruby-redtail/contact/addresses.rb, line 9
def fetch (contact_id)
  RubyRedtail::Query.run("contacts/#{contact_id}/addresses", @api_hash, "GET")
end
internet_addresses(contact_id) click to toggle source

Fetch Internet Addresses By Contact Id

# File lib/ruby-redtail/contact/addresses.rb, line 49
def internet_addresses (contact_id)
  RubyRedtail::Query.run("contacts/#{contact_id}/internets", @api_hash, "GET")
end
phones(contact_id) click to toggle source

Fetch Phones By Contact Id

# File lib/ruby-redtail/contact/addresses.rb, line 29
def phones (contact_id)
  RubyRedtail::Query.run("contacts/#{contact_id}/phones", @api_hash, "GET")
end
update(contact_id, address_id, params) click to toggle source

Update Address

# File lib/ruby-redtail/contact/addresses.rb, line 14
def update (contact_id, address_id, params)
  RubyRedtail::Query.run("contacts/#{contact_id}/addresses/#{address_id}", @api_hash, 'PUT', params)
end
update_internet_address(contact_id, internet_id, params) click to toggle source

Update Internet Address

# File lib/ruby-redtail/contact/addresses.rb, line 54
def update_internet_address (contact_id, internet_id, params)
  RubyRedtail::Query.run("contacts/#{contact_id}/phones/#{internet_id}", @api_hash, 'PUT', params)
end
update_phone(contact_id, phone_id, params) click to toggle source

Update Phone

# File lib/ruby-redtail/contact/addresses.rb, line 34
def update_phone (contact_id, phone_id, params)
  RubyRedtail::Query.run("contacts/#{contact_id}/phones/#{phone_id}", @api_hash, 'PUT', params)
end