Sha256: 7d706066b22592cdacce03c5a13fe08f026b58306548562ea94d5cefa32228f6

Contents?: true

Size: 492 Bytes

Versions: 56

Compression:

Stored size: 492 Bytes

Contents

# frozen_string_literal: true

module RBS
  class Constant
    attr_reader :name
    attr_reader :type
    attr_reader :entry

    def initialize(name:, type:, entry:)
      @name = name
      @type = type
      @entry = entry
    end

    def ==(other)
      other.is_a?(Constant) &&
        other.name == name &&
        other.type == type &&
        other.entry == entry
    end

    alias eql? ==

    def hash
      self.class.hash ^ name.hash ^ type.hash ^ entry.hash
    end
  end
end

Version data entries

56 entries across 56 versions & 2 rubygems

Version Path
rbs-3.4.2 lib/rbs/constant.rb
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/rbs-2.8.4/lib/rbs/constant.rb
rbs-3.4.1 lib/rbs/constant.rb
rbs-3.4.0 lib/rbs/constant.rb
rbs-3.4.0.pre.1 lib/rbs/constant.rb
rbs-3.3.2 lib/rbs/constant.rb
rbs-3.3.1 lib/rbs/constant.rb
rbs-3.3.0 lib/rbs/constant.rb
rbs-3.3.0.pre.2 lib/rbs/constant.rb
rbs-3.3.0.pre.1 lib/rbs/constant.rb
rbs-3.2.2 lib/rbs/constant.rb
rbs-3.2.1 lib/rbs/constant.rb
rbs-3.2.0 lib/rbs/constant.rb
rbs-3.2.0.pre.1 lib/rbs/constant.rb
rbs-3.1.3 lib/rbs/constant.rb
rbs-3.1.2 lib/rbs/constant.rb
rbs-3.1.1 lib/rbs/constant.rb
rbs-3.1.0 lib/rbs/constant.rb
rbs-3.0.4 lib/rbs/constant.rb
rbs-3.0.3 lib/rbs/constant.rb