Class: TZInfo::CountryInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/tzinfo/country_info.rb

Overview

Represents a country and references to its timezones as returned by a DataSource.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code, name) ⇒ CountryInfo

Constructs a new CountryInfo with an ISO 3166 country code and name



12
13
14
15
# File 'lib/tzinfo/country_info.rb', line 12

def initialize(code, name)
  @code = code
  @name = name
end

Instance Attribute Details

#codeObject (readonly)

The ISO 3166 country code.



6
7
8
# File 'lib/tzinfo/country_info.rb', line 6

def code
  @code
end

#nameObject (readonly)

The name of the country.



9
10
11
# File 'lib/tzinfo/country_info.rb', line 9

def name
  @name
end

Instance Method Details

#inspectObject

Returns internal object state as a programmer-readable string.



18
19
20
# File 'lib/tzinfo/country_info.rb', line 18

def inspect
  "#<#{self.class}: #@code>"
end

#zone_identifiersObject

Returns a frozen array of all the zone identifiers for the country. The identifiers are ordered by importance according to the DataSource.



24
25
26
# File 'lib/tzinfo/country_info.rb', line 24

def zone_identifiers
  raise_not_implemented('zone_identifiers')
end

#zonesObject

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.



32
33
34
# File 'lib/tzinfo/country_info.rb', line 32

def zones
  raise_not_implemented('zones')
end