Module: OnlineEntityModel

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/quickeebooks/common/online_entity_model.rb', line 3

def self.included(base)
  base.send :include, InstanceMethods
  base.extend ClassMethods
  base.class_eval do
    xml_convention :camelcase
    xml_accessor :id, :from => 'Id', :as => Quickeebooks::Online::Model::Id
    xml_accessor :sync_token, :from => 'SyncToken', :as => Integer
    xml_accessor :name, :from => 'Name'
    xml_accessor :meta_data, :from => 'MetaData', :as => Quickeebooks::Online::Model::MetaData
    xml_accessor :addresses, :from => 'Address', :as => [Quickeebooks::Online::Model::Address]
    xml_accessor :email, :from => 'Email', :as => Quickeebooks::Online::Model::Email
    xml_accessor :phones, :from => 'Phone', :as => [Quickeebooks::Online::Model::Phone]
    xml_accessor :web_site, :from => 'WebSite', :as => Quickeebooks::Online::Model::WebSite
    xml_accessor :given_name, :from => 'GivenName'
    xml_accessor :middle_name, :from => 'MiddleName'
    xml_accessor :family_name, :from => 'FamilyName'
    xml_accessor :suffix, :from => 'Suffix'
    xml_accessor :gender, :from => 'Gender'
    xml_accessor :dba_name, :from => 'DBAName'
    xml_accessor :show_as, :from => 'ShowAs'
    xml_accessor :tax_identifier, :from => 'TaxIdentifier'
    xml_accessor :sales_term_id, :from => 'SalesTermId', :as => Quickeebooks::Online::Model::Id
    xml_accessor :open_balance, :from => 'OpenBalance', :as => Quickeebooks::Online::Model::OpenBalance
    xml_accessor :external_id, :from => 'ExternalId'
  end
end