Class: SimCtl::DeviceLaunchctl
- Inherits:
-
Object
- Object
- SimCtl::DeviceLaunchctl
- Defined in:
- lib/simctl/device_launchctl.rb
Instance Method Summary collapse
-
#initialize(device) ⇒ DeviceLaunchctl
constructor
A new instance of DeviceLaunchctl.
- #list ⇒ Object
Constructor Details
#initialize(device) ⇒ DeviceLaunchctl
Returns a new instance of DeviceLaunchctl.
5 6 7 |
# File 'lib/simctl/device_launchctl.rb', line 5 def initialize(device) @device = device end |
Instance Method Details
#list ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/simctl/device_launchctl.rb', line 9 def list fields = %i[pid status name] device .spawn(device.path.launchctl, ['list']) .split("\n") .drop(1) .map { |item| Hash[fields.zip(item.split("\t"))] } .map { |item| OpenStruct.new(item) } end |