Sha256: 4684b81ac06621433d6cd60d2255727f2f90e33e6462bfc12efccaeab8e9f0e1

Contents?: true

Size: 467 Bytes

Versions: 11

Compression:

Stored size: 467 Bytes

Contents

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

    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

11 entries across 11 versions & 1 rubygems

Version Path
rbs-0.12.2 lib/rbs/constant.rb
rbs-0.12.1 lib/rbs/constant.rb
rbs-0.12.0 lib/rbs/constant.rb
rbs-0.11.0 lib/rbs/constant.rb
rbs-0.10.0 lib/rbs/constant.rb
rbs-0.9.1 lib/rbs/constant.rb
rbs-0.9.0 lib/rbs/constant.rb
rbs-0.8.0 lib/rbs/constant.rb
rbs-0.7.0 lib/rbs/constant.rb
rbs-0.6.0 lib/rbs/constant.rb
rbs-0.5.0 lib/rbs/constant.rb