Class: TZInfo::DataSources::ConstantOffsetDataTimezoneInfo
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
DataTimezoneInfo ,
TimezoneInfo
|
|
Instance Chain:
self,
DataTimezoneInfo ,
TimezoneInfo
|
|
Inherits: |
TZInfo::DataSources::DataTimezoneInfo
|
Defined in: | lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb |
Overview
Represents a data time zone defined by a constantly observed offset.
Class Method Summary
-
.new(identifier, constant_offset) ⇒ ConstantOffsetDataTimezoneInfo
constructor
Initializes a new
ConstantOffsetDataTimezoneInfo
.
TimezoneInfo
- Inherited
.new | Initializes a new |
Instance Attribute Summary
Instance Method Summary
- #period_for(timestamp) ⇒ TimezonePeriod
- #periods_for_local(local_timestamp) ⇒ Array<TimezonePeriod>
- #transitions_up_to(to_timestamp, from_timestamp = nil) ⇒ Array
- #constant_period ⇒ TimezonePeriod private
DataTimezoneInfo
- Inherited
#create_timezone, #period_for, | |
#periods_for_local | Returns an |
#transitions_up_to | Returns an |
#raise_not_implemented | Raises a |
TimezoneInfo
- Inherited
#create_timezone, #inspect, | |
#raise_not_implemented | Raises a |
Constructor Details
.new(identifier, constant_offset) ⇒ ConstantOffsetDataTimezoneInfo
Initializes a new ConstantOffsetDataTimezoneInfo
.
The passed in identifier
instance will be frozen. A reference to the
passed in ::TZInfo::TimezoneOffset
will be retained.
# File 'lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb', line 19
def initialize(identifier, constant_offset) super(identifier) raise ArgumentError, 'constant_offset must be specified' unless constant_offset @constant_offset = constant_offset end
Instance Attribute Details
#constant_offset ⇒ TimezoneOffset (readonly)
# File 'lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb', line 9
attr_reader :constant_offset
Instance Method Details
#constant_period ⇒ TimezonePeriod (private)
# File 'lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb', line 51
def constant_period OffsetTimezonePeriod.new(@constant_offset) end
#period_for(timestamp) ⇒ TimezonePeriod
# File 'lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb', line 28
def period_for( ) constant_period end
#periods_for_local(local_timestamp) ⇒ Array
<TimezonePeriod>
# File 'lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb', line 35
def periods_for_local( ) [constant_period] end
#transitions_up_to(to_timestamp, from_timestamp = nil) ⇒ Array
# File 'lib/tzinfo/data_sources/constant_offset_data_timezone_info.rb', line 43
def transitions_up_to(, = nil) [] end