Class: XCSim::DeviceListItem

Inherits:
Object
  • Object
show all
Defined in:
lib/xcsim/rbList.rb

Overview

An aggregate object containing information on a single iOS Simulator device returned by GetDeviceList#withPattern or GetDeviceList#allDevices

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(os, device, bundles) ⇒ DeviceListItem

Initializes a DeviceListItem instance with a given os, device and bundles array



21
22
23
24
25
# File 'lib/xcsim/rbList.rb', line 21

def initialize(os, device, bundles)
  @os = os
  @device = device
  @bundles = bundles
end

Instance Attribute Details

#bundlesObject (readonly)

An array of BundleInfo objects corresponding to the applications installed on the simulator in question



18
19
20
# File 'lib/xcsim/rbList.rb', line 18

def bundles
  @bundles
end

#deviceObject (readonly)

A DeviceID object corresponding to the device



14
15
16
# File 'lib/xcsim/rbList.rb', line 14

def device
  @device
end

#osObject (readonly)

An OSDevices object corresponding to the device OS version



11
12
13
# File 'lib/xcsim/rbList.rb', line 11

def os
  @os
end

Instance Method Details

#fullNameObject

Returns a string in "iPhone 5s (iOS 9.2)" format



28
29
30
# File 'lib/xcsim/rbList.rb', line 28

def fullName
  "#{device.name} (#{os.id})"
end

#inspectObject

Same as #fullName



38
39
40
# File 'lib/xcsim/rbList.rb', line 38

def inspect
  fullName
end

#shortNameObject

Returns device name



33
34
35
# File 'lib/xcsim/rbList.rb', line 33

def shortName
  device.name
end

#to_sObject

Same as #inspect



43
44
45
# File 'lib/xcsim/rbList.rb', line 43

def to_s
  inspect
end