Class: Packages

Inherits:
Object
  • Object
show all
Defined in:
lib/AIX/packages.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ Packages

Returns a new instance of Packages.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/AIX/packages.rb', line 7

def initialize(string)

  @list = Hash.new
  @data_string_raw=''


  if string.length > 0
    @data_string_raw = string
    self.parse(string)
  end
end

Instance Attribute Details

#listObject (readonly)

Returns the value of attribute list.



5
6
7
# File 'lib/AIX/packages.rb', line 5

def list
  @list
end

Instance Method Details

#parse(string) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/AIX/packages.rb', line 19

def parse(string)

  string.each_line do |line|
    package = Package.new(line)
    @list[package.fileset] = package
  end
end