Class: RBS::AST::Ruby::Annotations::SplatParamTypeAnnotation

Inherits:
Base
  • Object
show all
Defined in:
sig/ast/ruby/annotations.rbs,
lib/rbs/ast/ruby/annotations.rb

Overview

@rbs *name: Type -- comment annotation in leading comments

^^^^                         -- prefix_location
     ^                       -- star_location
      ^                      -- name_location
       ^                     -- colon_location
                ^^^^^^^^^^   -- comment_location
^^^^             -- prefix_location
     ^           -- star_location
      ^          -- colon_location

Instance Attribute Summary collapse

Attributes inherited from Base

#location, #prefix_location

Instance Method Summary collapse

Methods inherited from Base

#buffer

Constructor Details

#initialize(location:, prefix_location:, star_location:, name_location:, colon_location:, param_type:, comment_location:) ⇒ SplatParamTypeAnnotation

Returns a new instance of SplatParamTypeAnnotation.



291
292
293
294
295
296
297
298
# File 'lib/rbs/ast/ruby/annotations.rb', line 291

def initialize(location:, prefix_location:, star_location:, name_location:, colon_location:, param_type:, comment_location:)
  super(location, prefix_location)
  @star_location = star_location
  @name_location = name_location
  @colon_location = colon_location
  @param_type = param_type
  @comment_location = comment_location
end

Instance Attribute Details

#colon_locationLocation (readonly)

Returns the value of attribute colon_location.

Returns:



289
290
291
# File 'lib/rbs/ast/ruby/annotations.rb', line 289

def colon_location
  @colon_location
end

#comment_locationLocation? (readonly)

Returns the value of attribute comment_location.

Returns:



289
290
291
# File 'lib/rbs/ast/ruby/annotations.rb', line 289

def comment_location
  @comment_location
end

#name_locationLocation? (readonly)

Returns the value of attribute name_location.

Returns:



289
290
291
# File 'lib/rbs/ast/ruby/annotations.rb', line 289

def name_location
  @name_location
end

#param_typeTypes::t (readonly)

Returns the value of attribute param_type.

Returns:

  • (Types::t)


289
290
291
# File 'lib/rbs/ast/ruby/annotations.rb', line 289

def param_type
  @param_type
end

#star_locationLocation (readonly)

Returns the value of attribute star_location.

Returns:



289
290
291
# File 'lib/rbs/ast/ruby/annotations.rb', line 289

def star_location
  @star_location
end

Instance Method Details

#map_type_name {|arg0| ... } ⇒ self

Yields:

Yield Parameters:

Yield Returns:

Returns:

  • (self)


300
301
302
303
304
305
306
307
308
309
310
# File 'lib/rbs/ast/ruby/annotations.rb', line 300

def map_type_name(&block)
  self.class.new(
    location:,
    prefix_location:,
    star_location: star_location,
    name_location: name_location,
    colon_location: colon_location,
    param_type: param_type.map_type_name { yield _1 },
    comment_location: comment_location
  ) #: self
end

#nameSymbol?

Returns:

  • (Symbol, nil)


359
# File 'sig/ast/ruby/annotations.rbs', line 359

def name: () -> Symbol?

#type_fingerprintObject

Returns:

  • (Object)


312
313
314
315
316
317
318
319
# File 'lib/rbs/ast/ruby/annotations.rb', line 312

def type_fingerprint
  [
    "annots/splat_param_type",
    name_location&.source,
    param_type.to_s,
    comment_location&.source
  ]
end