Sha256: 69231fe320a3c85fb7bfe9e4d0fbc0a5b02668f64f62007b662b43f1fe2de250

Contents?: true

Size: 483 Bytes

Versions: 10

Compression:

Stored size: 483 Bytes

Contents

module RBS
  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

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
rbs-0.8.0 lib/rbs/ast/comment.rb
rbs-0.7.0 lib/rbs/ast/comment.rb
rbs-0.6.0 lib/rbs/ast/comment.rb
rbs-0.5.0 lib/rbs/ast/comment.rb
rbs-0.4.0 lib/rbs/ast/comment.rb
rbs-0.3.1 lib/rbs/ast/comment.rb
rbs-0.3.0 lib/rbs/ast/comment.rb
rbs-0.2.0 lib/rbs/ast/comment.rb
steep-0.16.0 vendor/ruby-signature/lib/rbs/ast/comment.rb
steep-0.15.0 vendor/ruby-signature/lib/rbs/ast/comment.rb