Class: LVM::VolumeGroups
- Inherits:
-
Object
- Object
- LVM::VolumeGroups
- Defined in:
- lib/lvm/volume_groups.rb
Instance Method Summary collapse
-
#each ⇒ Object
Gather all information about volume groups and their underlying logical and physical volumes.
-
#initialize(options) ⇒ VolumeGroups
constructor
A new instance of VolumeGroups.
- #list ⇒ Object
Methods included from Volumes
Constructor Details
#initialize(options) ⇒ VolumeGroups
Returns a new instance of VolumeGroups.
13 14 15 16 17 |
# File 'lib/lvm/volume_groups.rb', line 13 def initialize() @vgs = VGS.new() @pvs = PhysicalVolumes.new() @lvs = LogicalVolumes.new() end |
Instance Method Details
#each ⇒ Object
Gather all information about volume groups and their underlying logical and physical volumes.
This is the best representation of LVM data.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/lvm/volume_groups.rb', line 23 def each vgs = @vgs.list lvs = @lvs.list pvs = @pvs.list vgs.each do |vg| vg.logical_volumes = lvs.select { |lv| lv.vg_uuid == vg.uuid } vg.physical_volumes = pvs.select { |pv| pv.vg_uuid == vg.uuid } yield vg end end |
#list ⇒ Object
35 36 37 |
# File 'lib/lvm/volume_groups.rb', line 35 def list each {} end |