Class: SimCtl::Runtime

Inherits:
Object
  • Object
show all
Defined in:
lib/simctl/runtime.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Object

#initialize

Constructor Details

This class inherits a constructor from SimCtl::Object

Instance Attribute Details

#availabilityObject (readonly)

Returns the value of attribute availability.



5
6
7
# File 'lib/simctl/runtime.rb', line 5

def availability
  @availability
end

#buildversionObject (readonly)

Returns the value of attribute buildversion.



5
6
7
# File 'lib/simctl/runtime.rb', line 5

def buildversion
  @buildversion
end

#identifierObject (readonly)

Returns the value of attribute identifier.



5
6
7
# File 'lib/simctl/runtime.rb', line 5

def identifier
  @identifier
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/simctl/runtime.rb', line 5

def name
  @name
end

#versionObject (readonly)

Returns the value of attribute version.



5
6
7
# File 'lib/simctl/runtime.rb', line 5

def version
  @version
end

Class Method Details

.latest(type) ⇒ SimCtl::Runtime

Returns the latest available runtime

Parameters:

  • name (String)

    type (ios, watchos, tvos)

Returns:



17
18
19
# File 'lib/simctl/runtime.rb', line 17

def self.latest(type)
  SimCtl.list_runtimes.where(name: %r|#{type}|i).sort_by {|r| r.version}.reverse.first
end

Instance Method Details

#==(other) ⇒ Object



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

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