Class: PackerFiles::Core::Partition

Inherits:
Base
  • Object
show all
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

Instance Method Summary collapse

Methods inherited from Base

doc_file

Constructor Details

#initialize {|_self| ... } ⇒ Partition

Constructor to just specify accessor varibales

Yields:

  • (_self)

Yield Parameters:



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

#bootObject

Specify attributes



17
18
19
# File 'lib/PackerFiles/Core/Partition.rb', line 17

def boot
  @boot
end

#file_systemObject

Returns the value of attribute file_system.



21
22
23
# File 'lib/PackerFiles/Core/Partition.rb', line 21

def file_system
  @file_system
end

#labelObject

Returns the value of attribute label.



18
19
20
# File 'lib/PackerFiles/Core/Partition.rb', line 18

def label
  @label
end

#mount_pointObject

Returns the value of attribute mount_point.



20
21
22
# File 'lib/PackerFiles/Core/Partition.rb', line 20

def mount_point
  @mount_point
end

#nameObject

Returns the value of attribute name.



22
23
24
# File 'lib/PackerFiles/Core/Partition.rb', line 22

def name
  @name
end

#sizeObject

Returns the value of attribute size.



19
20
21
# File 'lib/PackerFiles/Core/Partition.rb', line 19

def size
  @size
end

Instance Method Details

#normalizeObject

Normalize the values

Raises:



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