Sha256: 1562ed09f148f0e6e17380ab0db04d6a23f69b2368b84d47d2c600d12c880db2

Contents?: true

Size: 549 Bytes

Versions: 3

Compression:

Stored size: 549 Bytes

Contents

module Ruby
  module Signature
    module AST
      class Comment
        attr_reader :string
        attr_reader :location

        def initialize(string:, location:)
          @string = string
          @location = location
        end

        def ==(other)
          other.is_a?(Comment) && other.string == string
        end

        alias eql? ==

        def hash
          self.class.hash ^ string.hash
        end

        def to_json(*a)
          { string: string, location: location }.to_json(*a)
        end
      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/ast/comment.rb
steep-0.13.0 vendor/ruby-signature/lib/ruby/signature/ast/comment.rb
steep-0.12.0 vendor/ruby-signature/lib/ruby/signature/ast/comment.rb