Class: Economic::DebtorContact
- Defined in:
- lib/economic/debtor_contact.rb
Overview
Represents a debtor contact.
API documentation: www.e-conomic.com/apidocs/Documentation/T_Economic_Api_IDebtorContact.html
Examples
# Find contact
contact = economic.contacts.find(:id => 5)
# Creating a contact
contact = debtor.contacts.build
contact.id = 0
contact.number = 0
contact.name = 'John Appleseed'
contact.save
Instance Attribute Summary
Attributes inherited from Entity
#id, #number, #partial, #persisted, #session
Instance Method Summary collapse
Methods inherited from Entity
#==, default_values, defaults, #destroy, #get, #get_data, #handle=, handle_writer, has_properties, #initialize, #inspect, key, #partial?, #persisted?, properties, properties_not_triggering_full_load, property_reader, property_writer, proxy, #proxy, #save, #update_properties
Constructor Details
This class inherits a constructor from Economic::Entity
Instance Method Details
#debtor ⇒ Object
31 32 33 34 |
# File 'lib/economic/debtor_contact.rb', line 31 def debtor return nil if debtor_handle.nil? @debtor ||= session.debtors.find(debtor_handle[:number]) end |
#debtor=(debtor) ⇒ Object
36 37 38 39 |
# File 'lib/economic/debtor_contact.rb', line 36 def debtor=(debtor) self.debtor_handle = debtor.handle @debtor = debtor end |
#debtor_handle=(handle) ⇒ Object
41 42 43 44 |
# File 'lib/economic/debtor_contact.rb', line 41 def debtor_handle=(handle) @debtor = nil unless handle == @debtor_handle @debtor_handle = handle end |
#handle ⇒ Object
46 47 48 |
# File 'lib/economic/debtor_contact.rb', line 46 def handle @handle || Handle.new(:id => @id) end |