class TZInfo::TZDataCountry
:nodoc:
@private
An ISO 3166 country.
def add_zone(zone)
def add_zone(zone) @zones << zone end
def initialize(code, name)
def initialize(code, name) @code = code @name = name @zones = [] end
def write_index_record(file)
def write_index_record(file) s = " country #{TZDataParser.quote_str(@code)}, #{TZDataParser.quote_str(@name)}" s << ' do |c|' if @zones.length > 0 file.puts s @zones.each do |zone| file.puts " c.timezone #{TZDataParser.quote_str(zone.timezone.name)}, #{zone.location.latitude.numerator}, #{zone.location.latitude.denominator}, #{zone.location.longitude.numerator}, #{zone.location.longitude.denominator}#{zone.description.nil? ? '' : ', ' + TZDataParser.quote_str(zone.description)}" end file.puts ' end' if @zones.length > 0 end