Class: Anywhere::SystemPackage

Inherits:
Object
  • Object
show all
Defined in:
lib/anywhere/system_package.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, version, arch = nil) ⇒ SystemPackage

Returns a new instance of SystemPackage.



15
16
17
18
19
# File 'lib/anywhere/system_package.rb', line 15

def initialize(name, version, arch = nil)
  @name = name
  @version = version
  @arch = arch
end

Instance Attribute Details

#archObject (readonly)

Returns the value of attribute arch.



3
4
5
# File 'lib/anywhere/system_package.rb', line 3

def arch
  @arch
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/anywhere/system_package.rb', line 3

def name
  @name
end

#versionObject (readonly)

Returns the value of attribute version.



3
4
5
# File 'lib/anywhere/system_package.rb', line 3

def version
  @version
end

Class Method Details

.from_list(list) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/anywhere/system_package.rb', line 6

def from_list(list)
  list.split("\n").map do |line|
    name_and_arch, version = line.strip.split("\t")
    name, arch = name_and_arch.split(":")
    self.new(name, version, arch)
  end
end