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
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/offset_timezone_period.rb
fablicop-1.10.2 vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/tzinfo-2.0.6/lib/tzinfo/offset_timezone_period.rb
tzinfo-2.0.6 lib/tzinfo/offset_timezone_period.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/offset_timezone_period.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/offset_timezone_period.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/tzinfo-2.0.5/lib/tzinfo/offset_timezone_period.rb
tzinfo-2.0.5 lib/tzinfo/offset_timezone_period.rb
ric-0.14.2 vendor/bundle/ruby/2.7.0/gems/tzinfo-2.0.4/lib/tzinfo/offset_timezone_period.rb
ric-0.14.1 vendor/bundle/ruby/2.7.0/gems/tzinfo-2.0.4/lib/tzinfo/offset_timezone_period.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/tzinfo-2.0.4/lib/tzinfo/offset_timezone_period.rb
ric-0.14.0 vendor/bundle/ruby/2.7.0/gems/tzinfo-2.0.4/lib/tzinfo/offset_timezone_period.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/tzinfo-2.0.4/lib/tzinfo/offset_timezone_period.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/tzinfo-2.0.4/lib/tzinfo/offset_timezone_period.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/tzinfo-2.0.4/lib/tzinfo/offset_timezone_period.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tzinfo-2.0.4/lib/tzinfo/offset_timezone_period.rb
tzinfo-2.0.4 lib/tzinfo/offset_timezone_period.rb
tzinfo-2.0.3 lib/tzinfo/offset_timezone_period.rb
metanorma-cli-1.3.4 gems/ruby/2.6.0/gems/tzinfo-2.0.2/lib/tzinfo/offset_timezone_period.rb
metanorma-cli-1.3.3.1 gems/ruby/2.6.0/gems/tzinfo-2.0.2/lib/tzinfo/offset_timezone_period.rb