Class: DeviceAPI::IOS::Device
- Inherits:
-
Device
- Object
- Device
- DeviceAPI::IOS::Device
- Defined in:
- lib/device_api/ios/device.rb
Overview
Namespace for the Device object.
Instance Method Summary collapse
-
#device_class ⇒ String
Return the device class - i.e.
-
#imei ⇒ String
Get the IMEI number of the device.
-
#initialize(options = {}) ⇒ Device
constructor
A new instance of Device.
-
#model ⇒ String
Look up device model using the ios-devices gem - changing ‘iPad4,7’ to ‘iPad mini 3’.
-
#status ⇒ String
Mapping of device status - used to provide a consistent status across platforms.
-
#trusted? ⇒ Boolean
Has the ‘Trust this device’ dialog been accepted?.
-
#version ⇒ String
Returns the devices iOS version number - i.e.
Constructor Details
#initialize(options = {}) ⇒ Device
Returns a new instance of Device.
12 13 14 15 |
# File 'lib/device_api/ios/device.rb', line 12 def initialize( = {}) @serial = [:serial] @state = [:state] end |
Instance Method Details
#device_class ⇒ String
Return the device class - i.e. iPad, iPhone, etc
41 42 43 |
# File 'lib/device_api/ios/device.rb', line 41 def device_class get_prop('DeviceClass') end |
#imei ⇒ String
Get the IMEI number of the device
47 48 49 |
# File 'lib/device_api/ios/device.rb', line 47 def imei get_prop('InternationalMobileEquipmentIdentity') end |
#model ⇒ String
Look up device model using the ios-devices gem - changing ‘iPad4,7’ to ‘iPad mini 3’
29 30 31 |
# File 'lib/device_api/ios/device.rb', line 29 def model Ios::Devices.search(get_prop('ProductType')).name end |
#status ⇒ String
Mapping of device status - used to provide a consistent status across platforms
19 20 21 22 23 24 25 |
# File 'lib/device_api/ios/device.rb', line 19 def status { 'device' => :ok, 'no device' => :dead, 'offline' => :offline }[@state] end |
#trusted? ⇒ Boolean
Has the ‘Trust this device’ dialog been accepted?
53 54 55 |
# File 'lib/device_api/ios/device.rb', line 53 def trusted? IDevice.trusted?(serial) end |
#version ⇒ String
Returns the devices iOS version number - i.e. 8.2
35 36 37 |
# File 'lib/device_api/ios/device.rb', line 35 def version get_prop('ProductVersion') end |