class TZInfo::TZDataLocation
:nodoc:
@private
A location (latitude + longitude)
def initialize(coordinates)
or +-DDMMSS+-DDDMMSS, first latitude (+ is north),
sign-degrees-minutes-seconds format, either +-DDMM+-DDDMM
Constructs a new TZDataLocation from a string in ISO 6709
def initialize(coordinates) if coordinates !~ /^([+\-])([0-9]{2})([0-9]{2})([0-9]{2})?([+\-])([0-9]{3})([0-9]{2})([0-9]{2})?$/ raise "Invalid coordinates: #{coordinates}" end @latitude = Rational($2.to_i) + Rational($3.to_i, 60) @latitude += Rational($4.to_i, 3600) unless $4.nil? @latitude = -@latitude if $1 == '-' @longitude = Rational($6.to_i) + Rational($7.to_i, 60) @longitude += Rational($8.to_i, 3600) unless $8.nil? @longitude = -@longitude if $5 == '-' end