lib/simctl/device.rb in simctl-1.5.7 vs lib/simctl/device.rb in simctl-1.5.8
- old
+ new
@@ -28,18 +28,10 @@
# @return [SimCtl::DeviceType]
def devicetype
@devicetype ||= SimCtl.devicetype(identifier: plist.deviceType)
end
- # <b>DEPRECATED:</b> Please use <tt>device.settings.disable_keyboard_helpers!</tt> instead.
- # Disables the keyboard helpers
- #
- # @return [void]
- def disable_keyboard_helpers!
- settings.disable_keyboard_helpers!
- end
-
# Erases the device
#
# @return [void]
def erase!
SimCtl.erase_device(self)
@@ -110,10 +102,11 @@
# Renames the device
#
# @return [void]
def rename!(name)
SimCtl.rename_device(self, name)
+ @name = name
end
# Resets the device
#
# @return [void]
@@ -124,9 +117,20 @@
# Resets the runtime
#
# @return [SimCtl::Runtime]
def runtime
@runtime ||= SimCtl.runtime(identifier: plist.runtime)
+ end
+
+ # Saves a screenshot to a file
+ #
+ # @param file Path where the screenshot should be saved to
+ # @param opts Optional hash that supports two keys:
+ # * type: Can be png, tiff, bmp, gif, jpeg (default is png)
+ # * display: Can be main or tv for iOS, tv for tvOS and main for watchOS
+ # @return [void]
+ def screenshot!(file, opts={})
+ SimCtl.screenshot(self, file, opts)
end
# Returns the settings object
#
# @ return [SimCtl::DeviceSettings]