class RBS::AST::Ruby::Annotations::InstanceVariableAnnotation
@rbs IVAR-NAME : TYPE annotation in leading comments
@rbs @foo : String -- comment
^^^^ -- prefix_location
^^^^ -- ivar_name_location
^ -- colon_location
^^^^^^^^^^ -- comment_location
Attributes
colon_location
[R]
Location
comment_location
[R]
Location?
ivar_name_location
[R]
Location
type
[R]
Types::t
Public Class Methods
(location: Location, prefix_location: Location, ivar_name: Symbol, ivar_name_location: Location, colon_location: Location, type: Types::t, comment_location: Location?) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/ruby/annotations.rb, line 225 def initialize(location:, prefix_location:, ivar_name:, ivar_name_location:, colon_location:, type:, comment_location:) super(location, prefix_location) @ivar_name = ivar_name @ivar_name_location = ivar_name_location @colon_location = colon_location @type = type @comment_location = comment_location end
Calls superclass method
RBS::AST::Ruby::Annotations::Base::new
Public Instance Methods
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/ruby/annotations.rb, line 234 def map_type_name(&block) self.class.new( location:, prefix_location:, ivar_name:, ivar_name_location:, colon_location:, type: type.map_type_name { yield _1 }, comment_location: ) #: self end
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/ruby/annotations.rb, line 246 def type_fingerprint [ "annots/instance_variable", ivar_name.to_s, type.to_s, comment_location&.source ] end