Class: TZInfo::ZoneinfoCountryInfo
- Inherits:
-
CountryInfo
- Object
- CountryInfo
- TZInfo::ZoneinfoCountryInfo
- Defined in:
- lib/tzinfo/zoneinfo_country_info.rb
Overview
Represents information about a country returned by ZoneinfoDataSource.
Instance Attribute Summary
Attributes inherited from CountryInfo
Instance Method Summary collapse
-
#initialize(code, name, zones) ⇒ ZoneinfoCountryInfo
constructor
Constructs a new CountryInfo with an ISO 3166 country code, name and an array of CountryTimezones.
-
#zone_identifiers ⇒ Object
Returns a frozen array of all the zone identifiers for the country ordered geographically, most populous first.
-
#zones ⇒ Object
Returns a frozen array of all the timezones for the for the country ordered geographically, most populous first.
Methods inherited from CountryInfo
Constructor Details
#initialize(code, name, zones) ⇒ ZoneinfoCountryInfo
Constructs a new CountryInfo with an ISO 3166 country code, name and an array of CountryTimezones.
28 29 30 31 32 |
# File 'lib/tzinfo/zoneinfo_country_info.rb', line 28 def initialize(code, name, zones) super(code, name) @zones = zones.dup.freeze @zone_identifiers = nil end |
Instance Method Details
#zone_identifiers ⇒ Object
Returns a frozen array of all the zone identifiers for the country ordered geographically, most populous first.
36 37 38 39 40 41 42 |
# File 'lib/tzinfo/zoneinfo_country_info.rb', line 36 def zone_identifiers unless @zone_identifiers @zone_identifiers = zones.collect {|zone| zone.identifier}.freeze end @zone_identifiers end |
#zones ⇒ Object
Returns a frozen array of all the timezones for the for the country ordered geographically, most populous first.
46 47 48 |
# File 'lib/tzinfo/zoneinfo_country_info.rb', line 46 def zones @zones end |