%PDF- %PDF-
| Direktori : /var/lib/rbenv/versions/3.1.3/lib64/ruby/gems/3.1.0/gems/rbs-2.7.0/lib/rbs/ast/ |
| Current File : /var/lib/rbenv/versions/3.1.3/lib64/ruby/gems/3.1.0/gems/rbs-2.7.0/lib/rbs/ast/annotation.rb |
# frozen_string_literal: true
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