class TZInfo::CountryTimezone

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/tzinfo/country_timezone.rbs

class TZInfo::CountryTimezone
  def initialize: (String identifier, Rational latitude, Rational longitude, ?String description) -> void
end

Information about a time zone used by a {Country}.

def ==(ct)

Returns:
  • (TrueClass) - `true` if `ct` is equal to the current instance.

Parameters:
  • ct (Object) -- the object to be compared.
def ==(ct)
  ct.kind_of?(CountryTimezone) &&
    identifier == ct.identifier  && latitude == ct.latitude &&
    longitude == ct.longitude   && description == ct.description
end

def description_or_friendly_identifier

Returns:
  • (String) - the {description} if present, otherwise a human-readable
def description_or_friendly_identifier
  description || timezone.friendly_identifier(true)
end

def eql?(ct)

Returns:
  • (Boolean) - `true` if `ct` is equal to the current instance.

Parameters:
  • ct (Object) -- the object to be compared.
def eql?(ct)
  self == ct
end

def hash

Returns:
  • (Integer) - a hash based on the {identifier}, {latitude},
def hash
  [@identifier, @latitude, @longitude, @description].hash
end

def initialize(identifier, latitude, longitude, description = nil)

Experimental RBS support (using type sampling data from the type_fusion project).

def initialize: (String identifier, Rational latitude, Rational longitude, ?String description) -> void

This signature was generated using 1 sample from 1 application.

Parameters:
  • description (String) -- an optional description of the time zone.
  • longitude (Rational) -- the longitude of the time zone.
  • latitude (Rational) -- the latitude of the time zone.
  • identifier (String) -- the {Timezone} identifier.
def initialize(identifier, latitude, longitude, description = nil)
  @identifier = identifier.freeze
  @latitude = latitude
  @longitude = longitude
  @description = description && description.freeze
end

def timezone

Returns:
  • (Timezone) - the associated {Timezone}.
def timezone
  Timezone.get_proxy(@identifier)
end