Class: Xero::Models::Item

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

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



18
19
20
21
22
23
# File 'lib/xero/models/item.rb', line 18

def to_xero_xml
  xero_attributes(attributes.clone).tap do |attrs|
    merge_purchase_details(attrs) unless purchase_details.blank?
    merge_sales_details(attrs) unless sales_details.blank?
  end.to_xml(root: 'Item')
end