Class: Anywhere::SystemPackage
- Inherits:
-
Object
- Object
- Anywhere::SystemPackage
- Defined in:
- lib/anywhere/system_package.rb
Instance Attribute Summary collapse
-
#arch ⇒ Object
readonly
Returns the value of attribute arch.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, version, arch = nil) ⇒ SystemPackage
constructor
A new instance of SystemPackage.
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
#arch ⇒ Object (readonly)
Returns the value of attribute arch.
3 4 5 |
# File 'lib/anywhere/system_package.rb', line 3 def arch @arch end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/anywhere/system_package.rb', line 3 def name @name end |
#version ⇒ Object (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 |