Sha256: ff71ea2468e0e0ca4d74b9c4515a50e96085c81aba75a06b8160628e80fe6917

Contents?: true

Size: 461 Bytes

Versions: 57

Compression:

Stored size: 461 Bytes

Contents

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

57 entries across 57 versions & 1 rubygems

Version Path
rbs-2.6.0 lib/rbs/constant.rb
rbs-2.5.1 lib/rbs/constant.rb
rbs-2.5.0 lib/rbs/constant.rb
rbs-2.4.0 lib/rbs/constant.rb
rbs-2.3.2 lib/rbs/constant.rb
rbs-2.3.1 lib/rbs/constant.rb
rbs-2.3.0 lib/rbs/constant.rb
rbs-2.2.2 lib/rbs/constant.rb
rbs-2.2.1 lib/rbs/constant.rb
rbs-2.2.0 lib/rbs/constant.rb
rbs-2.1.0 lib/rbs/constant.rb
rbs-2.0.0 lib/rbs/constant.rb
rbs-2.0.0.pre2 lib/rbs/constant.rb
rbs-2.0.0.pre1 lib/rbs/constant.rb
rbs-1.8.1 lib/rbs/constant.rb
rbs-1.8.0 lib/rbs/constant.rb
rbs-1.7.1 lib/rbs/constant.rb
rbs-1.7.0 lib/rbs/constant.rb
rbs-1.7.0.beta.5 lib/rbs/constant.rb
rbs-1.7.0.beta.4 lib/rbs/constant.rb