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.8.1 lib/rbs/constant.rb
rbs-3.8.0 lib/rbs/constant.rb
rbs-3.8.0.pre.1 lib/rbs/constant.rb
rbs-3.7.0.pre.1 lib/rbs/constant.rb
rbs-3.7.0.dev.1 lib/rbs/constant.rb
rbs-3.6.1 lib/rbs/constant.rb
rbs-3.6.0 lib/rbs/constant.rb
rbs-3.6.0.pre.3 lib/rbs/constant.rb
rbs-3.6.0.pre.2 lib/rbs/constant.rb
rbs-3.6.0.pre.1 lib/rbs/constant.rb
rbs-3.6.0.dev.1 lib/rbs/constant.rb
rbs-3.5.3 lib/rbs/constant.rb
rbs-3.5.2 lib/rbs/constant.rb
rbs-3.5.1 lib/rbs/constant.rb
rbs-3.5.1.pre.1 lib/rbs/constant.rb
rbs-3.5.0 lib/rbs/constant.rb
rbs-3.5.0.pre.2 lib/rbs/constant.rb
rbs-3.5.0.pre.1 lib/rbs/constant.rb
rbs-3.4.4 lib/rbs/constant.rb
rbs-3.4.3 lib/rbs/constant.rb