Class: LVM::PhysicalVolumes

Inherits:
Object
  • Object
show all
Includes:
Enumerable, Volumes, Wrapper
Defined in:
lib/lvm/physical_volumes.rb

Instance Method Summary collapse

Methods included from Volumes

#[], #to_s

Constructor Details

#initialize(options) ⇒ PhysicalVolumes

Returns a new instance of PhysicalVolumes.



12
13
14
15
# File 'lib/lvm/physical_volumes.rb', line 12

def initialize(options)
  @pvs = PVS.new(options)
  @pvsseg = PVSSEG.new(options)
end

Instance Method Details

#eachObject

Gather all information about physical volumes.

See VolumeGroups.each for a better representation of LVM data.



20
21
22
23
24
25
26
27
28
# File 'lib/lvm/physical_volumes.rb', line 20

def each
  pvs = @pvs.list
  pvsseg = @pvsseg.list

  pvs.each do |pv|
    pv.segments = pvsseg.select { |seg| seg.pv_uuid == pv.uuid }
    yield pv
  end
end

#listObject



30
31
32
# File 'lib/lvm/physical_volumes.rb', line 30

def list
  each {}
end