Class: TZInfo::ZoneinfoCountryInfo

Inherits:
CountryInfo show all
Defined in:
lib/tzinfo/zoneinfo_country_info.rb

Overview

Represents information about a country returned by ZoneinfoDataSource.

Instance Attribute Summary

Attributes inherited from CountryInfo

#code, #name

Instance Method Summary collapse

Methods inherited from CountryInfo

#inspect

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_identifiersObject

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

#zonesObject

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