class TZInfo::DataSources::DataTimezoneInfo
@abstract Data sources return instances of {DataTimezoneInfo} subclasses.
({ConstantOffsetDataTimezoneInfo}).
({TransitionsDataTimezoneInfo}) or a constantly observed offset
The base class for time zones defined as either a series of transitions
def create_timezone
-
(DataTimezone)
- a new {DataTimezone} instance for the time zone
def create_timezone DataTimezone.new(self) end
def period_for(timestamp)
-
(ArgumentError)
- may be raised if `timestamp` is `nil` or does not
Returns:
-
(TimezonePeriod)
- the {TimezonePeriod} observed at the time
Parameters:
-
timestamp
(Timestamp
) -- a {Timestamp} with a specified
def period_for(timestamp) raise_not_implemented('period_for') end
def periods_for_local(local_timestamp)
-
(ArgumentError)
- may be raised if `local_timestamp` is `nil`, or
Returns:
-
(Array
- an `Array` containing the)
Parameters:
-
local_timestamp
(Timestamp
) -- a {Timestamp} representing a local
def periods_for_local(local_timestamp) raise_not_implemented('periods_for_local') end
def raise_not_implemented(method_name)
incorrectly being used directly.
Raises a {NotImplementedError} to indicate that the base class is
def raise_not_implemented(method_name) raise NotImplementedError, "Subclasses must override #{method_name}" end
def transitions_up_to(to_timestamp, from_timestamp = nil)
-
(ArgumentError)
- may be raised if `from_timestamp` is specified -
(ArgumentError)
- may be raised if `from_timestamp` is specified -
(ArgumentError)
- may be raised if `to_timestamp` is `nil` or does
Returns:
-
(Array
- an `Array` of {TimezoneTransition})
Parameters:
-
from_timestamp
(Timestamp
) -- an optional {Timestamp} with a -
to_timestamp
(Timestamp
) -- a {Timestamp} with a specified
def transitions_up_to(to_timestamp, from_timestamp = nil) raise_not_implemented('transitions_up_to') end