class Jamf::ManagementHistory::MobileDeviceApp

MobileDeviceApp - an app deployed to a MobileDevice

This should only be instantiated by the ManagementHistory.app_history method when mixed in to Mobile devices.

That method will return an array of these objects.

NOTE: some attributes will be nil for some statuses (e.g. no size data if not installed)

Public Instance Methods

bundle_size_kb() click to toggle source

@return [Integer] The size of the app bundle in kb, e.g. 29033

   # File lib/jamf/api/classic/api_objects/management_history/mobile_device_app.rb
96 def bundle_size_kb
97   size_to_kb @bundle_size if @bundle_size
98 end
dynamic_size_kb() click to toggle source

@return [Integer] The dynamic size of the app in kb, e.g. 29033

    # File lib/jamf/api/classic/api_objects/management_history/mobile_device_app.rb
102 def dynamic_size_kb
103   size_to_kb @dynamic_size if @dynamic_size
104 end
managed?() click to toggle source

@return [Boolean] If :installed and :in_house, is it managed?

   # File lib/jamf/api/classic/api_objects/management_history/mobile_device_app.rb
90 def managed?
91   @management_status == HIST_RAW_STATUS_MANAGED
92 end
status() click to toggle source

@return [Symbol] :installed, :pending, :failed, or :unknown

   # File lib/jamf/api/classic/api_objects/management_history/mobile_device_app.rb
77 def status
78   case @management_status
79   when HIST_RAW_STATUS_INSTALLED then :installed
80   when HIST_RAW_STATUS_MANAGED then :installed
81   when HIST_RAW_STATUS_UNMANAGED then :installed
82   when HIST_RAW_STATUS_PENDING then :pending
83   when HIST_RAW_STATUS_FAILED then :failed
84   else :unknown
85   end
86 end

Private Instance Methods

size_to_kb(raw_size) click to toggle source

@param [String] A raw size value from the API

@return [Integer] the size as an integer of Kb

    # File lib/jamf/api/classic/api_objects/management_history/mobile_device_app.rb
110 def size_to_kb(raw_size)
111   val, unit = raw_size.split ' '
112   val = val.to_i
113   case unit.downcase
114   when 'kb' then val
115   when 'mb' then val * 1024
116   when 'gb' then val * 1024 * 1024
117   end # case unit
118 end