Class: RBS::AST::Ruby::Annotations::ParamTypeAnnotation
- Defined in:
- lib/rbs/ast/ruby/annotations.rb
Instance Attribute Summary collapse
-
#colon_location ⇒ Object
readonly
Returns the value of attribute colon_location.
-
#comment_location ⇒ Object
readonly
Returns the value of attribute comment_location.
-
#name_location ⇒ Object
readonly
Returns the value of attribute name_location.
-
#param_type ⇒ Object
readonly
Returns the value of attribute param_type.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(location:, prefix_location:, name_location:, colon_location:, param_type:, comment_location:) ⇒ ParamTypeAnnotation
constructor
A new instance of ParamTypeAnnotation.
- #map_type_name(&block) ⇒ Object
- #type_fingerprint ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(location:, prefix_location:, name_location:, colon_location:, param_type:, comment_location:) ⇒ ParamTypeAnnotation
Returns a new instance of ParamTypeAnnotation.
259 260 261 262 263 264 265 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 259 def initialize(location:, prefix_location:, name_location:, colon_location:, param_type:, comment_location:) super(location, prefix_location) @name_location = name_location @colon_location = colon_location @param_type = param_type @comment_location = comment_location end |
Instance Attribute Details
#colon_location ⇒ Object (readonly)
Returns the value of attribute colon_location.
257 258 259 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 257 def colon_location @colon_location end |
#comment_location ⇒ Object (readonly)
Returns the value of attribute comment_location.
257 258 259 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 257 def comment_location @comment_location end |
#name_location ⇒ Object (readonly)
Returns the value of attribute name_location.
257 258 259 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 257 def name_location @name_location end |
#param_type ⇒ Object (readonly)
Returns the value of attribute param_type.
257 258 259 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 257 def param_type @param_type end |
Instance Method Details
#map_type_name(&block) ⇒ Object
267 268 269 270 271 272 273 274 275 276 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 267 def map_type_name(&block) self.class.new( location:, prefix_location:, name_location: name_location, colon_location: colon_location, param_type: param_type.map_type_name { yield _1 }, comment_location: comment_location ) #: self end |
#type_fingerprint ⇒ Object
278 279 280 281 282 283 284 285 |
# File 'lib/rbs/ast/ruby/annotations.rb', line 278 def type_fingerprint [ "annots/param_type", name_location.source, param_type.to_s, comment_location&.source ] end |