Method: Jamf::Purchasable#purchasing_xml
- Defined in:
- lib/jamf/api/classic/api_objects/purchasable.rb
#purchasing_xml ⇒ REXML::Element
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns A <purchasing> element to be included in the rest_xml of objects that mix-in this module.
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
# File 'lib/jamf/api/classic/api_objects/purchasable.rb', line 280 def purchasing_xml purch = REXML::Element.new('purchasing') purch.add_element('applecare_id').text = @applecare_id purch.add_element('is_leased').text = @is_leased purch.add_element('is_purchased').text = @is_purchased.to_s purch.add_element('lease_expires_epoch').text = @lease_expires ? @lease_expires.to_jss_epoch : nil # Note, life expectancy can't be an empty xml element, it must be zero if emtpy. purch.add_element('life_expectancy').text = @life_expectancy || 0 purch.add_element('po_date_epoch').text = @po_date ? @po_date.to_jss_epoch : nil purch.add_element('po_number').text = @po_number purch.add_element('purchase_price').text = @purchase_price purch.add_element('purchasing_account').text = @purchasing_account purch.add_element('purchasing_contact').text = @purchasing_contact purch.add_element('vendor').text = @vendor purch.add_element('warranty_expires_epoch').text = @warranty_expires ? @warranty_expires.to_jss_epoch : nil purch end |