class RBS::AST::Ruby::Annotations::ReturnTypeAnnotation
@rbs return: T -- comment annotation in leading comments
@rbs return: String -- Returns a string
^^^ -- prefix_location
^^^^^^ -- return_location
^ -- colon_location
^^^^^^^^^^^^^^^^^^^ -- comment
Attributes
colon_location
[R]
Location
comment_location
[R]
Location?
return_location
[R]
Location
return_type
[R]
Types::t
Public Class Methods
(location: Location, prefix_location: Location, return_location: Location, colon_location: Location, return_type: Types::t, comment_location: Location?) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.1.3/lib/rbs/ast/ruby/annotations.rb, line 164 def initialize(location:, prefix_location:, return_location:, colon_location:, return_type:, comment_location:) super(location, prefix_location) @return_location = return_location @colon_location = colon_location @return_type = return_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.1.3/lib/rbs/ast/ruby/annotations.rb, line 172 def map_type_name(&block) self.class.new( location:, prefix_location:, return_location: return_location, colon_location: colon_location, return_type: return_type.map_type_name { yield _1 }, comment_location: comment_location ) #: self end
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.1.3/lib/rbs/ast/ruby/annotations.rb, line 183 def type_fingerprint [ "annots/return_type", return_type.to_s, comment_location&.source ] end