class TZInfo::CountryTimezone
multiple countries).
Timezone that is specific to the Country (a Timezone could be used by
A Timezone within a Country. This contains extra information about the
def ==(ct)
current CountryTimezone (has the same identifer, latitude, longitude
Returns true if and only if the given CountryTimezone is equal to the
def ==(ct) ct.kind_of?(CountryTimezone) && identifier == ct.identifier && latitude == ct.latitude && longitude == ct.longitude && description == ct.description end
def description_or_friendly_identifier
if description is not nil, this method returns description; otherwise it
def description_or_friendly_identifier description || timezone.friendly_identifier(true) end
def eql?(ct)
current CountryTimezone (has the same identifer, latitude, longitude
Returns true if and only if the given CountryTimezone is equal to the
def eql?(ct) self == ct end
def hash
def hash @identifier.hash ^ @latitude_numerator.hash ^ @latitude_denominator.hash ^ @longitude_numerator.hash ^ @longitude_denominator.hash ^ @description.hash end
def initialize(identifier, latitude_numerator, latitude_denominator,
numerators and denominators must be specified in their lowest form.
rationals - a numerator and denominator. For performance reasons, the
longitude and description. The latitude and longitude are specified as
Creates a new CountryTimezone with a timezone identifier, latitude,
def initialize(identifier, latitude_numerator, latitude_denominator, longitude_numerator, longitude_denominator, description = nil) #:nodoc: @identifier = identifier @latitude_numerator = latitude_numerator @latitude_denominator = latitude_denominator @longitude_numerator = longitude_numerator @longitude_denominator = longitude_denominator @description = description end
def inspect
def inspect "#<#{self.class}: #@identifier>" end
def latitude
def latitude @latitude ||= RubyCoreSupport.rational_new!(@latitude_numerator, @latitude_denominator) end
def longitude
def longitude @longitude ||= RubyCoreSupport.rational_new!(@longitude_numerator, @longitude_denominator) end
def timezone
def timezone Timezone.get_proxy(@identifier) end