lib/simctl/device.rb in simctl-1.6.5 vs lib/simctl/device.rb in simctl-1.6.6

- old
+ new

@@ -6,16 +6,28 @@ require 'simctl/object' require 'timeout' module SimCtl class Device < Object - attr_reader :availability, :name, :os, :state, :udid + extend Gem::Deprecate + attr_reader :is_available, :name, :os, :state, :udid + + def initialize(args) + args['is_available'] = args.delete('isAvailable') + super + end + + def availability + is_available + end + deprecate :availability, :is_available, 2020, 8 + # Returns true/false if the device is available # # @return [Bool] def available? - availability !~ /unavailable/i + is_available !~ /unavailable/i end # Boots the device # # @return [void]