Module: Virtuous::Client::ContactAddress
- Included in:
- Virtuous::Client
- Defined in:
- lib/virtuous/client/contact_address.rb
Overview
Contact Address data
{
contact_id: [Integer],
label: [String],
address1: [String],
address2: [String],
city: [String],
state: [String],
postal: [String],
country: [String],
set_as_primary: [Boolean],
start_month: [Integer],
start_day: [Integer],
end_month: [Integer],
end_day: [Integer]
}
Instance Method Summary collapse
-
#create_contact_address(data) ⇒ Hash
Creates an address.
-
#get_contact_addresses(contact_id) ⇒ Array
Gets the addresses of a contact.
-
#update_contact_address(id, data) ⇒ Hash
Updates an address.
Instance Method Details
#create_contact_address(data) ⇒ Hash
Creates an address.
73 74 75 |
# File 'lib/virtuous/client/contact_address.rb', line 73 def create_contact_address(data) parse(post('api/ContactAddress', format(data))) end |
#get_contact_addresses(contact_id) ⇒ Array
Gets the addresses of a contact.
33 34 35 36 |
# File 'lib/virtuous/client/contact_address.rb', line 33 def get_contact_addresses(contact_id) response = get("api/ContactAddress/ByContact/#{contact_id}") response.map { |address| parse(address) } end |
#update_contact_address(id, data) ⇒ Hash
Note:
Excluding a property will remove it's value from the object.
Updates an address.
If you're only updating a single property, the entire model is still required.
55 56 57 |
# File 'lib/virtuous/client/contact_address.rb', line 55 def update_contact_address(id, data) parse(put("api/ContactAddress/#{id}", format(data))) end |