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 69

#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 72

#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 63

#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 54

#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 60

#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 66

#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 57

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



96
97
98
# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 96

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



102
103
104
# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 102

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)


90
91
92
# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 90

def managed?
  @management_status == HIST_RAW_STATUS_MANAGED
end

#statusSymbol

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

Returns:

  • (Symbol)

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



77
78
79
80
81
82
83
84
85
86
# File 'lib/jss/api_object/management_history/mobile_device_app.rb', line 77

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