class TZInfo::CountryInfo

:nodoc:
class are passed to the blocks in the index that define timezones.
Class to store the data loaded from the country index. Instances of this

def initialize(code, name, &block)

(when they are first needed).
block. The block will be evaluated to obtain the timezones for the country
Constructs a new CountryInfo with an ISO 3166 country code, name and
def initialize(code, name, &block)
  @code = code
  @name = name
  @block = block
  @zones = nil
  @zone_identifiers = nil
end

def inspect

Returns internal object state as a programmer-readable string.
def inspect
  "#<#{self.class}: #@code>"
end

def timezone(identifier, latitude_numerator, latitude_denominator,

Called by the index data to define a timezone for the country.
def timezone(identifier, latitude_numerator, latitude_denominator, 
             longitude_numerator, longitude_denominator, description = nil)
  # Currently only store the identifiers.
  @zones << CountryTimezone.new(identifier, latitude_numerator, 
    latitude_denominator, longitude_numerator, longitude_denominator,
    description)     
end

def zone_identifiers

are in the order they were added using the timezone method.
Returns a frozen array of all the zone identifiers for the country. These
def zone_identifiers
  unless @zone_identifiers
    @zone_identifiers = zones.collect {|zone| zone.identifier}
    @zone_identifiers.freeze
  end
  
  @zone_identifiers
end

def zones

the timezone method.
CountryTimezone instances. These are in the order they were added using
Returns a frozen array of all the timezones for the for the country as
def zones
  unless @zones
    @zones = []
    @block.call(self) if @block
    @block = nil
    @zones.freeze
  end
  
  @zones
end