Class: JSS::ManagementHistory::MobileDeviceApp

Inherits:
Object
  • Object
show all
Includes:
HashLike
Defined in:
lib/jss/api_object/management_history/mobile_device_app.rb

Overview

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)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bundle_sizeString (readonly)

Returns The size of the app bundle as text, e.g. '28 MB'

Returns:

  • (String)

    The size of the app bundle as text, e.g. '28 MB'


# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 45

#dynamic_sizeString (readonly)

Returns The dynamic size of the app as text, e.g. '28 MB'

Returns:

  • (String)

    The dynamic size of the app as text, e.g. '28 MB'


# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 48

#management_statusString (readonly)

Returns The raw status, used for #managed? and #status

Returns:

  • (String)

    The raw status, used for #managed? and #status


# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 39

#nameString (readonly)

Returns the name of the app.

Returns:

  • (String)

    the name of the app.


# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 30

#short_versionString (readonly)

Returns The short_version of the app

Returns:

  • (String)

    The short_version of the app


# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 36

#sourceSymbol (readonly)

Returns :in_house, :app_store, or :other

Returns:

  • (Symbol)

    :in_house, :app_store, or :other


# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 42

#versionString (readonly)

Returns The version of the app

Returns:

  • (String)

    The version of the app


# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 33

Instance Method Details

#[](attr) ⇒ Object Originally defined in module HashLike

#bundle_size_kbInteger

Returns The size of the app bundle in kb, e.g. 29033

Returns:

  • (Integer)

    The size of the app bundle in kb, e.g. 29033


72
73
74
# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 72

def bundle_size_kb
  size_to_kb @bundle_size if @bundle_size
end

#dynamic_size_kbInteger

Returns The dynamic size of the app in kb, e.g. 29033

Returns:

  • (Integer)

    The dynamic size of the app in kb, e.g. 29033


78
79
80
# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 78

def dynamic_size_kb
  size_to_kb @dynamic_size if @dynamic_size
end

#managed?Boolean

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

Returns:

  • (Boolean)

66
67
68
# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 66

def managed?
  @management_status == HIST_RAW_STATUS_MANAGED
end

#statusSymbol

Returns :installed, :pending, :failed, or :unknown

Returns:

  • (Symbol)

    :installed, :pending, :failed, or :unknown


53
54
55
56
57
58
59
60
61
62
# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 53

def status
  case @management_status
  when HIST_RAW_STATUS_INSTALLED then :installed
  when HIST_RAW_STATUS_MANAGED then :installed
  when HIST_RAW_STATUS_UNMANAGED then :installed
  when HIST_RAW_STATUS_PENDING then :pending
  when HIST_RAW_STATUS_FAILED then :failed
  else :unknown
  end
end