class TZInfo::CountryInfo
Represents a country and references to its timezones as returned by a DataSource
.
Attributes
code[R]
The ISO 3166 country code.
name[R]
The name of the country.
Public Class Methods
new(code, name)
click to toggle source
Constructs a new CountryInfo
with an ISO 3166 country code and name
# File lib/tzinfo/country_info.rb, line 12 def initialize(code, name) @code = code @name = name end
Public Instance Methods
inspect()
click to toggle source
Returns internal object state as a programmer-readable string.
# File lib/tzinfo/country_info.rb, line 18 def inspect "#<#{self.class}: #@code>" end
zone_identifiers()
click to toggle source
Returns a frozen array of all the zone identifiers for the country. The identifiers are ordered by importance according to the DataSource
.
# File lib/tzinfo/country_info.rb, line 24 def zone_identifiers raise_not_implemented('zone_identifiers') end
zones()
click to toggle source
Returns a frozen array of all the timezones for the for the country as CountryTimezone
instances.
The timezones are ordered by importance according to the DataSource
.
# File lib/tzinfo/country_info.rb, line 32 def zones raise_not_implemented('zones') end
Private Instance Methods
raise_not_implemented(method_name)
click to toggle source
# File lib/tzinfo/country_info.rb, line 38 def raise_not_implemented(method_name) raise NotImplementedError, "Subclasses must override #{method_name}" end