Class: SimCtl::Runtime

Inherits:
Object
  • Object
show all
Extended by:
Gem::Deprecate
Defined in:
lib/simctl/runtime.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Runtime

Returns a new instance of Runtime.



10
11
12
13
# File 'lib/simctl/runtime.rb', line 10

def initialize(args)
  args['is_available'] = args.delete('isAvailable')
  super
end

Instance Attribute Details

#buildversionObject (readonly)

Returns the value of attribute buildversion.



8
9
10
# File 'lib/simctl/runtime.rb', line 8

def buildversion
  @buildversion
end

#identifierObject (readonly)

Returns the value of attribute identifier.



8
9
10
# File 'lib/simctl/runtime.rb', line 8

def identifier
  @identifier
end

#is_availableObject (readonly)

Returns the value of attribute is_available.



8
9
10
# File 'lib/simctl/runtime.rb', line 8

def is_available
  @is_available
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/simctl/runtime.rb', line 8

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/simctl/runtime.rb', line 8

def type
  @type
end

#versionObject (readonly)

Returns the value of attribute version.



8
9
10
# File 'lib/simctl/runtime.rb', line 8

def version
  @version
end

Class Method Details

.latest(type) ⇒ SimCtl::Runtime

Returns the latest available runtime

Parameters:

  • name (String)

    type (ios, watchos, tvos)

Returns:



34
35
36
# File 'lib/simctl/runtime.rb', line 34

def self.latest(type)
  Naturally.sort_by(SimCtl.list_runtimes.where(identifier: /#{type}/i), :version).last
end

Instance Method Details

#==(other) ⇒ Object



24
25
26
27
28
# File 'lib/simctl/runtime.rb', line 24

def ==(other)
  return false if other.nil?
  return false unless other.is_a? Runtime
  other.identifier == identifier
end

#availabilityObject



15
16
17
# File 'lib/simctl/runtime.rb', line 15

def availability
  is_available
end