Sha256: 38944b6ca81c0748d46a823f29467ef2ab086481764898b5b68469c567783d3e

Contents?: true

Size: 569 Bytes

Versions: 3

Compression:

Stored size: 569 Bytes

Contents

module Ruby
  module Signature
    class Constant
      attr_reader :name
      attr_reader :type
      attr_reader :declaration

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

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

      alias eql? ==

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
steep-0.14.0 vendor/ruby-signature/lib/ruby/signature/constant.rb
steep-0.13.0 vendor/ruby-signature/lib/ruby/signature/constant.rb
steep-0.12.0 vendor/ruby-signature/lib/ruby/signature/constant.rb