class RBS::AST::Ruby::Annotations::MethodTypesAnnotation
@rbs METHOD-TYPEs annotation in leading comments
@rbs () -> void | %a{foo} () -> String | ...
^^^^ -- prefix_location
^ -- vertical_bar_locations[0]
^ -- vertical_bar_locations[1]
^^^ -- dot3_location
Constants
- Overload
Attributes
dot3_location
[R]
Location?
overloads
[R]
Array[Overload]
vertical_bar_locations
[R]
Array[Location]
Public Class Methods
(location: Location, prefix_location: Location, overloads: Array[Overload], vertical_bar_locations: Array[Location], dot3_location: Location?) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/ruby/annotations.rb, line 114 def initialize(location:, prefix_location:, overloads:, vertical_bar_locations:, dot3_location:) super(location, prefix_location) @overloads = overloads @vertical_bar_locations = vertical_bar_locations @dot3_location = dot3_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 121 def map_type_name(&block) ovs = overloads.map do |overload| Overload.new( method_type: overload.method_type.map_type {|type| type.map_type_name { yield _1 } }, annotations: overload.annotations ) end self.class.new(location:, prefix_location:, overloads: ovs, vertical_bar_locations:, dot3_location:) #: self end
() → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/ruby/annotations.rb, line 132 def type_fingerprint [ "annots/method_types", overloads.map { |o| [o.annotations.map(&:to_s), o.method_type.to_s] }, overloading: dot3_location ? true : false ] end