Module: TZInfo::TimezoneDefinition::ClassMethods

Defined in:
lib/tzinfo/timezone_definition.rb

Overview

Class methods for inclusion.

Instance Method Summary collapse

Instance Method Details

#getObject

Returns the last TimezoneInfo to be defined with timezone or linked_timezone.



51
52
53
# File 'lib/tzinfo/timezone_definition.rb', line 51

def get
  @timezone
end

#linked_timezone(identifier, link_to_identifier) ⇒ Object

Defines a linked timezone.



45
46
47
# File 'lib/tzinfo/timezone_definition.rb', line 45

def linked_timezone(identifier, link_to_identifier)
  @timezone = LinkedTimezoneInfo.new(identifier, link_to_identifier)
end

#timezone(identifier) {|@timezone = DataTimezoneInfo.new(identifier)| ... } ⇒ Object

Returns and yields a DataTimezoneInfo object to define a timezone.

Yields:



40
41
42
# File 'lib/tzinfo/timezone_definition.rb', line 40

def timezone(identifier)
  yield @timezone = DataTimezoneInfo.new(identifier)
end