Class: PackerFiles::Core::Partition
- Defined in:
- lib/PackerFiles/Core/Partition.rb
Overview
Define the Partition class that can handle Partition specified in a Packerfile. Just the barebones attributes that are required for this class are specified here. The conversion of these attributes into a OS build specific file is done by derived classes in the OS specific directories.
Instance Attribute Summary collapse
-
#boot ⇒ Object
Specify attributes.
-
#file_system ⇒ Object
Returns the value of attribute file_system.
-
#label ⇒ Object
Returns the value of attribute label.
-
#mount_point ⇒ Object
Returns the value of attribute mount_point.
-
#name ⇒ Object
Returns the value of attribute name.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Partition
constructor
Constructor to just specify accessor varibales.
-
#normalize ⇒ Object
Normalize the values.
Methods inherited from Base
Constructor Details
#initialize {|_self| ... } ⇒ Partition
Constructor to just specify accessor varibales
25 26 27 28 29 |
# File 'lib/PackerFiles/Core/Partition.rb', line 25 def initialize @boot = false @size = 0 yield self if block_given? end |
Instance Attribute Details
#boot ⇒ Object
Specify attributes
17 18 19 |
# File 'lib/PackerFiles/Core/Partition.rb', line 17 def boot @boot end |
#file_system ⇒ Object
Returns the value of attribute file_system.
21 22 23 |
# File 'lib/PackerFiles/Core/Partition.rb', line 21 def file_system @file_system end |
#label ⇒ Object
Returns the value of attribute label.
18 19 20 |
# File 'lib/PackerFiles/Core/Partition.rb', line 18 def label @label end |
#mount_point ⇒ Object
Returns the value of attribute mount_point.
20 21 22 |
# File 'lib/PackerFiles/Core/Partition.rb', line 20 def mount_point @mount_point end |
#name ⇒ Object
Returns the value of attribute name.
22 23 24 |
# File 'lib/PackerFiles/Core/Partition.rb', line 22 def name @name end |
#size ⇒ Object
Returns the value of attribute size.
19 20 21 |
# File 'lib/PackerFiles/Core/Partition.rb', line 19 def size @size end |
Instance Method Details
#normalize ⇒ Object
Normalize the values
32 33 34 35 |
# File 'lib/PackerFiles/Core/Partition.rb', line 32 def normalize raise NilException.new(self, 'name') if @name.nil? raise 'size cannot be zero' if @size == 0 end |