Class: TZInfo::DataSources::TimezoneInfo Abstract
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Inherits: | Object |
Defined in: | lib/tzinfo/data_sources/timezone_info.rb |
Overview
This class is abstract.
Data sources return instances of TimezoneInfo
subclasses.
Represents a time zone defined by a data source.
Class Method Summary
-
.new(identifier) ⇒ TimezoneInfo
constructor
Initializes a new
TimezoneInfo
.
Instance Attribute Summary
- #identifier ⇒ String readonly
Instance Method Summary
- #create_timezone ⇒ Timezone
- #inspect ⇒ String
-
#raise_not_implemented(method_name)
private
Raises a
NotImplementedError
.
Constructor Details
.new(identifier) ⇒ TimezoneInfo
Initializes a new TimezoneInfo
. The passed in #identifier instance will
be frozen.
# File 'lib/tzinfo/data_sources/timezone_info.rb', line 18
def initialize(identifier) raise ArgumentError, 'identifier must be specified' unless identifier @identifier = identifier.freeze end
Instance Attribute Details
#identifier ⇒ String
(readonly)
# File 'lib/tzinfo/data_sources/timezone_info.rb', line 11
attr_reader :identifier
Instance Method Details
#create_timezone ⇒ Timezone
# File 'lib/tzinfo/data_sources/timezone_info.rb', line 31
def create_timezone raise_not_implemented('create_timezone') end
#inspect ⇒ String
# File 'lib/tzinfo/data_sources/timezone_info.rb', line 25
def inspect "#<#{self.class}: #@identifier>" end
#raise_not_implemented(method_name) (private)
Raises a NotImplementedError
.
# File 'lib/tzinfo/data_sources/timezone_info.rb', line 42
def raise_not_implemented(method_name) raise NotImplementedError, "Subclasses must override #{method_name}" end