class RBS::AST::Annotation
RBS allows writing annotations of declarations and members.
%a{annotation_here}
class Hello
%a{rbs:test:skip}
def foo: () -> void
end
Attributes
location
[R]
Location[untyped, untyped]?
Public Class Methods
(string: String, location: Location[untyped, untyped]?) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/annotation.rb, line 9 def initialize(string:, location:) @string = string @location = location end
Public Instance Methods
(untyped other) → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/annotation.rb, line 14 def ==(other) other.is_a?(Annotation) && other.string == string end
Also aliased as: eql?, eql?
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/annotation.rb, line 20 def hash self.class.hash ^ string.hash end
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/annotation.rb, line 24 def to_json(state = nil) { string: string, location: location }.to_json(state) end