Class: Xero::Models::Invoice

Inherits:
BaseModel show all
Defined in:
lib/xero/models/invoice.rb

Constant Summary collapse

TYPES =
['ACCPAY', 'ACCREC']

Instance Attribute Summary

Attributes inherited from BaseModel

#client, #new_record

Instance Method Summary collapse

Methods inherited from BaseModel

#attributes=, #cleanup_hash, #initialize, #persisted?, #save, #xero_attributes

Constructor Details

This class inherits a constructor from Xero::Models::BaseModel

Instance Method Details

#to_xero_xmlObject



41
42
43
44
45
46
47
# File 'lib/xero/models/invoice.rb', line 41

def to_xero_xml
  xero_attributes(attributes.clone).tap do |attrs|
    merge_contact(attrs) unless contact.blank?
    merge_line_items(attrs) unless line_items.blank?
    merge_payments(attrs) unless payments.blank?
  end.to_xml(root: 'Invoice')
end