Class: LVM::LogicalVolumes
- Inherits:
-
Object
- Object
- LVM::LogicalVolumes
- Defined in:
- lib/lvm/logical_volumes.rb
Instance Method Summary collapse
-
#each ⇒ Object
Gather all information about logical volumes.
-
#initialize(options) ⇒ LogicalVolumes
constructor
A new instance of LogicalVolumes.
Methods included from Volumes
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() @lvs = LVS.new() @lvsseg = LVSSEG.new() end |
Instance Method Details
#each ⇒ Object
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 29 30 31 32 33 34 |
# File 'lib/lvm/logical_volumes.rb', line 20 def each lvs = @lvs.list lvsseg = @lvsseg.list lvs.each do |lv| lv.segments ||= [] lvsseg.each do |lvseg| if lvseg.lv_uuid == lv.uuid lv.segments << lvseg end end end return lvs.each {|l| yield l} end |