123456789_123456789_123456789_123456789_123456789_

Class: TZInfo::InfoTimezone Abstract

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Timezone
Instance Chain:
self, Timezone, Comparable
Inherits: TZInfo::Timezone
Defined in: lib/tzinfo/info_timezone.rb

Overview

This class is abstract.

A Timezone based on a DataSources::TimezoneInfo.

Class Attribute Summary

Timezone - Inherited

.default_dst

Returns the default value of the optional dst parameter of the local_time, local_datetime and local_timestamp, local_to_utc and period_for_local methods (nil, true or false).

.default_dst=

Sets the default value of the optional dst parameter of the local_datetime, local_time, local_timestamp, local_to_utc and period_for_local methods.

Class Method Summary

Timezone - Inherited

._load

Loads a Timezone from the serialized representation returned by _dump.

.all

Returns an Array of all the available time zones.

.all_country_zone_identifiers

Returns an Array of the identifiers of all the time zones that are observed by at least one Country.

.all_country_zones

Returns an Array of all the time zones that are observed by at least one Country.

.all_data_zone_identifiers

time zones that are defined by offsets and transitions.

.all_data_zones

Returns an Array of all the available time zones that are defined by offsets and transitions.

.all_identifiers,
.all_linked_zone_identifiers

time zones that are defined as links to / aliases for other time zones.

.all_linked_zones

Returns an Array of all the available time zones that are defined as links to / aliases for other time zones.

.get

Returns a time zone by its IANA Time Zone Database identifier (e.g. "Europe/London" or "America/Chicago").

.get_proxy

Returns a proxy for the time zone with the given identifier.

.data_source, .get_proxies

Instance Method Summary

Timezone - Inherited

#<=>

Compares this Timezone with another based on the #identifier.

#=~

Matches regexp against the #identifier of this Timezone.

#_dump

Returns a serialized representation of this Timezone.

#abbr
#abbreviation,
#base_utc_offset

Returns the base offset from UTC in seconds at the given time.

#canonical_identifier

Returns the canonical identifier of this time zone.

#canonical_zone

Returns the canonical Timezone instance for this Timezone.

#current_period,
#current_period_and_time
#current_time_and_period

Returns the current local time and TimezonePeriod for the time zone as an Array.

#dst?, #eql?,
#friendly_identifier

Returns #identifier, modified to make it more readable.

#hash, #identifier, #inspect,
#local_datetime

Creates a DateTime object based on the given (Gregorian calendar) date and time parameters.

#local_time

Creates a Time object based on the given (Gregorian calendar) date and time parameters.

#local_timestamp

Creates a Timestamp object based on the given (Gregorian calendar) date and time parameters.

#local_to_utc

Converts a local time for the time zone to UTC.

#name, #now,
#observed_utc_offset

Returns the observed offset from UTC in seconds at the given time.

#offsets_up_to

Returns the unique offsets used by the time zone up to a given time (to) as an Array of TimezoneOffset instances.

#period_for

Returns the TimezonePeriod that is valid at a given time.

#period_for_local

Returns the TimezonePeriod that is valid at the given local time.

#period_for_utc

Returns the TimezonePeriod that is valid at a given time.

#periods_for_local

Returns the set of TimezonePeriods that are valid for the given local time as an Array.

#strftime

Converts a time to local time for the time zone and returns a String representation of the local time according to the given format.

#to_local

Converts a time to the local time for the time zone.

#to_s,
#transitions_up_to

Returns an Array of TimezoneTransition instances representing the times where the UTC offset of the timezone changes.

#utc_offset
#utc_to_local

Converts a time in UTC to the local time for the time zone.

#raise_unknown_timezone

Raises an UnknownTimezone exception.

Constructor Details

.new(info) ⇒ InfoTimezone

Initializes a new InfoTimezone.

InfoTimezone instances should not normally be created directly. Use the Timezone.get method to obtain Timezone instances.

Parameters:

[ GitHub ]

  
# File 'lib/tzinfo/info_timezone.rb', line 17

def initialize(info)
  super()
  @info = info
end

Instance Method Details

#identifierString

Returns:

  • (String)

    the identifier of the time zone, for example, "Europe/Paris".

[ GitHub ]

  
# File 'lib/tzinfo/info_timezone.rb', line 23

def identifier
  @info.identifier
end

#infoDataSources::TimezoneInfo (protected)

Returns:

[ GitHub ]

  
# File 'lib/tzinfo/info_timezone.rb', line 31

def info
  @info
end