Sha256: c551cc87174948e3c1d31cd43037938e6fab4c3db79ba95a068264559816e571

Contents?: true

Size: 505 Bytes

Versions: 35

Compression:

Stored size: 505 Bytes

Contents

module RBS
  module AST
    class Annotation
      attr_reader :string
      attr_reader :location

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

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

      alias eql? ==

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

      def to_json(state = _ = nil)
        { string: string, location: location }.to_json(state)
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
rbs-1.7.0.beta.3 lib/rbs/ast/annotation.rb
rbs-1.7.0.beta.2 lib/rbs/ast/annotation.rb
rbs-1.7.0.beta.1 lib/rbs/ast/annotation.rb
rbs-1.6.2 lib/rbs/ast/annotation.rb
rbs-1.6.1 lib/rbs/ast/annotation.rb
rbs-1.6.0 lib/rbs/ast/annotation.rb
rbs-1.5.1 lib/rbs/ast/annotation.rb
rbs-1.5.0 lib/rbs/ast/annotation.rb
rbs-1.4.0 lib/rbs/ast/annotation.rb
rbs-1.3.3 lib/rbs/ast/annotation.rb
rbs-1.3.2 lib/rbs/ast/annotation.rb
rbs-1.3.1 lib/rbs/ast/annotation.rb
rbs-1.3.0 lib/rbs/ast/annotation.rb
rbs-1.2.1 lib/rbs/ast/annotation.rb
rbs-1.2.0 lib/rbs/ast/annotation.rb