class PackerFiles::Core::TimeZone

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.

Attributes

auto[RW]
utc[RW]

Specify attributes

zone[RW]

Public Class Methods

doc_file() click to toggle source

Documentation for this class

# File lib/PackerFiles/Core/TimeZone.rb, line 22
def self.doc_file
   PackerFiles.DirPath('Core/example/TimeZone.txt').first
end
new() { |self| ... } click to toggle source

Constructor to just specify accessor varibales

# File lib/PackerFiles/Core/TimeZone.rb, line 27
def initialize
  @utc      = true
  yield self if block_given?
end

Public Instance Methods

normalize() click to toggle source

Normalize the various values into something useful. The default implementation checks only errors

# 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