Class: PackerFiles::Core::TimeZone
- Defined in:
- lib/PackerFiles/Core/TimeZone.rb
Overview
Define the TimeZone class that can handle TimeZone 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
-
#auto ⇒ Object
Returns the value of attribute auto.
-
#utc ⇒ Object
Specify attributes.
-
#zone ⇒ Object
Returns the value of attribute zone.
Class Method Summary collapse
-
.doc_file ⇒ Object
Documentation for this class.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ TimeZone
constructor
Constructor to just specify accessor varibales.
-
#normalize ⇒ Object
Normalize the various values into something useful.
Constructor Details
#initialize {|_self| ... } ⇒ TimeZone
Constructor to just specify accessor varibales
27 28 29 30 |
# File 'lib/PackerFiles/Core/TimeZone.rb', line 27 def initialize @utc = true yield self if block_given? end |
Instance Attribute Details
#auto ⇒ Object
Returns the value of attribute auto.
19 20 21 |
# File 'lib/PackerFiles/Core/TimeZone.rb', line 19 def auto @auto end |
#utc ⇒ Object
Specify attributes
17 18 19 |
# File 'lib/PackerFiles/Core/TimeZone.rb', line 17 def utc @utc end |
#zone ⇒ Object
Returns the value of attribute zone.
18 19 20 |
# File 'lib/PackerFiles/Core/TimeZone.rb', line 18 def zone @zone end |
Class Method Details
.doc_file ⇒ Object
Documentation for this class
22 23 24 |
# File 'lib/PackerFiles/Core/TimeZone.rb', line 22 def self.doc_file PackerFiles.DirPath('Core/example/TimeZone.txt').first end |
Instance Method Details
#normalize ⇒ Object
Normalize the various values into something useful. The default implementation checks only errors
34 35 36 37 38 39 |
# File 'lib/PackerFiles/Core/TimeZone.rb', line 34 def normalize raise NilException.new(self, 'zone') if @zone.nil? && @auto.nil? if (@zone.nil? && @auto) @zone = Utils::AutoZone.new.time_zone end end |