Class: PackerFiles::Core::LogicalVolume
- Includes:
- Utils::Size
- Defined in:
- lib/PackerFiles/Core/LogicalVolume.rb
Overview
Abstraction for Logical Volume
Instance Attribute Summary collapse
-
#file_system ⇒ Object
Returns the value of attribute file_system.
-
#mount_point ⇒ Object
Returns the value of attribute mount_point.
-
#name ⇒ Object
Returns the value of attribute name.
-
#size ⇒ Object
Specify attributes.
-
#vg_name ⇒ Object
Returns the value of attribute vg_name.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ LogicalVolume
constructor
Constructor to just specify accessor varibales.
-
#normalize ⇒ Object
Normalize the values.
Methods included from Utils::Size
Methods inherited from Base
Constructor Details
#initialize {|_self| ... } ⇒ LogicalVolume
Constructor to just specify accessor varibales
24 25 26 27 |
# File 'lib/PackerFiles/Core/LogicalVolume.rb', line 24 def initialize @size = 0 yield self if block_given? end |
Instance Attribute Details
#file_system ⇒ Object
Returns the value of attribute file_system.
19 20 21 |
# File 'lib/PackerFiles/Core/LogicalVolume.rb', line 19 def file_system @file_system end |
#mount_point ⇒ Object
Returns the value of attribute mount_point.
18 19 20 |
# File 'lib/PackerFiles/Core/LogicalVolume.rb', line 18 def mount_point @mount_point end |
#name ⇒ Object
Returns the value of attribute name.
20 21 22 |
# File 'lib/PackerFiles/Core/LogicalVolume.rb', line 20 def name @name end |
#size ⇒ Object
Specify attributes
17 18 19 |
# File 'lib/PackerFiles/Core/LogicalVolume.rb', line 17 def size @size end |
#vg_name ⇒ Object
Returns the value of attribute vg_name.
21 22 23 |
# File 'lib/PackerFiles/Core/LogicalVolume.rb', line 21 def vg_name @vg_name end |
Instance Method Details
#normalize ⇒ Object
Normalize the values
30 31 32 33 34 35 |
# File 'lib/PackerFiles/Core/LogicalVolume.rb', line 30 def normalize raise NilException.new(self, 'name') if @name.nil? raise NilException.new(self, 'vg_name') if @vg_name.nil? raise 'size cannot be zero' if @size == 0 @size = MiB(@size) end |