Sha256: 439908be5a3375ef06675b810e4c24157f450372e0c9e769f71c5535d9967c24

Contents?: true

Size: 1.26 KB

Versions: 43

Compression:

Stored size: 1.26 KB

Contents

# encoding: UTF-8

module TZInfo
  # Represents the infinite period of time in a time zone that constantly
  # observes the same offset from UTC (has an unbounded start and end).
  class OffsetTimezonePeriod < TimezonePeriod
    # Initializes an {OffsetTimezonePeriod}.
    #
    # @param offset [TimezoneOffset] the offset that is constantly observed.
    # @raise [ArgumentError] if `offset` is `nil`.
    def initialize(offset)
      super
    end

    # @return [TimezoneTransition] the transition that defines the start of this
    #   {TimezonePeriod}, always `nil` for {OffsetTimezonePeriod}.
    def start_transition
      nil
    end

    # @return [TimezoneTransition] the transition that defines the end of this
    #   {TimezonePeriod}, always `nil` for {OffsetTimezonePeriod}.
    def end_transition
      nil
    end

    # Determines if this {OffsetTimezonePeriod} is equal to another instance.
    #
    # @param p [Object] the instance to test for equality.
    # @return [Boolean] `true` if `p` is a {OffsetTimezonePeriod} with the same
    #   {offset}, otherwise `false`.
    def ==(p)
      p.kind_of?(OffsetTimezonePeriod) && offset == p.offset
    end
    alias eql? ==

    # @return [Integer] a hash based on {offset}.
    def hash
      offset.hash
    end
  end
end

Version data entries

43 entries across 39 versions & 20 rubygems

Version Path
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
fluent-plugin-nuopenlineage-light-0.1.0 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
fluent-plugin-openlineage-light-0.1.4 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
fluent-plugin-openlineage-light-0.1.3 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
fluent-plugin-openlineage-0.1.0 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/tzinfo-2.0.4/lib/tzinfo/offset_timezone_period.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/tzinfo-2.0.5/lib/tzinfo/offset_timezone_period.rb
mlh-rubocop-config-1.0.2 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
fablicop-1.10.3 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/tzinfo-2.0.5/lib/tzinfo/offset_timezone_period.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/tzinfo-2.0.4/lib/tzinfo/offset_timezone_period.rb