Method: JSS::Purchasable#parse_purchasing

Defined in:
lib/jss/api_object/purchasable.rb

#parse_purchasingObject

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.

Call this during initialization of objects that have a Purchasing subset and the purchasing attribute will be populated from @init_data

[View source]

265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/jss/api_object/purchasable.rb', line 265

def parse_purchasing
  return unless @init_data[:purchasing]

  @purchasing = @init_data[:purchasing]

  @lease_expires = JSS.epoch_to_time  @purchasing[:lease_expires_epoch]
  @po_date = JSS.epoch_to_time  @purchasing[:po_date_epoch]
  @warranty_expires = JSS.epoch_to_time  @purchasing[:warranty_expires_epoch]

  @applecare_id = @purchasing[:applecare_id]
  @is_leased = @purchasing[:is_leased]
  @is_purchased = @purchasing[:is_purchased]
  @life_expectancy = @purchasing[:life_expectancy]
  @po_number = @purchasing[:po_number]
  @purchase_price = @purchasing[:purchase_price].to_f if @purchasing[:purchase_price]
  @purchasing_account = @purchasing[:purchasing_account]
  @purchasing_contact = @purchasing[:purchasing_contact]
  @vendor = @purchasing[:vendor]
end