Class: LVM::LogicalVolumes

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

Instance Method Summary collapse

Methods included from Volumes

#[], #to_s

Constructor Details

#initialize(options) ⇒ LogicalVolumes

Returns a new instance of LogicalVolumes.



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

def initialize(options)
  @lvs = LVS.new(options)
  @lvsseg = LVSSEG.new(options)
end

Instance Method Details

#eachObject

Gather all information about logical volumes.

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



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

def each
  lvs = @lvs.list
  lvsseg = @lvsseg.list

  lvs.each do |lv|
    lv.segments = lvsseg.select { |seg| seg.lv_uuid == lv.uuid }
    yield lv
  end
end

#listObject



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

def list
  each {}
end