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-2.6.0 lib/rbs/ast/annotation.rb
rbs-2.5.1 lib/rbs/ast/annotation.rb
rbs-2.5.0 lib/rbs/ast/annotation.rb
rbs-2.4.0 lib/rbs/ast/annotation.rb
rbs-2.3.2 lib/rbs/ast/annotation.rb
rbs-2.3.1 lib/rbs/ast/annotation.rb
rbs-2.3.0 lib/rbs/ast/annotation.rb
rbs-2.2.2 lib/rbs/ast/annotation.rb
rbs-2.2.1 lib/rbs/ast/annotation.rb
rbs-2.2.0 lib/rbs/ast/annotation.rb
rbs-2.1.0 lib/rbs/ast/annotation.rb
rbs-2.0.0 lib/rbs/ast/annotation.rb
rbs-2.0.0.pre2 lib/rbs/ast/annotation.rb
rbs-2.0.0.pre1 lib/rbs/ast/annotation.rb
rbs-1.8.1 lib/rbs/ast/annotation.rb
rbs-1.8.0 lib/rbs/ast/annotation.rb
rbs-1.7.1 lib/rbs/ast/annotation.rb
rbs-1.7.0 lib/rbs/ast/annotation.rb
rbs-1.7.0.beta.5 lib/rbs/ast/annotation.rb
rbs-1.7.0.beta.4 lib/rbs/ast/annotation.rb