Class: RBS::AST::Ruby::Annotations::DoubleSplatParamTypeAnnotation

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
     ^^                     -- star2_location
       ^                    -- name_location
        ^                   -- colon_location
                ^^^^^^^^^^  -- comment_location
^^^^            -- prefix_location
     ^^         -- star2_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:, star2_location:, name_location:, colon_location:, param_type:, comment_location:) ⇒ DoubleSplatParamTypeAnnotation

Returns a new instance of DoubleSplatParamTypeAnnotation.



325
326
327
328
329
330
331
332
# File 'lib/rbs/ast/ruby/annotations.rb', line 325

def initialize(location:, prefix_location:, star2_location:, name_location:, colon_location:, param_type:, comment_location:)
  super(location, prefix_location)
  @star2_location = star2_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:



323
324
325
# File 'lib/rbs/ast/ruby/annotations.rb', line 323

def colon_location
  @colon_location
end

#comment_locationLocation? (readonly)

Returns the value of attribute comment_location.

Returns:



323
324
325
# File 'lib/rbs/ast/ruby/annotations.rb', line 323

def comment_location
  @comment_location
end

#name_locationLocation? (readonly)

Returns the value of attribute name_location.

Returns:



323
324
325
# File 'lib/rbs/ast/ruby/annotations.rb', line 323

def name_location
  @name_location
end

#param_typeTypes::t (readonly)

Returns the value of attribute param_type.

Returns:

  • (Types::t)


323
324
325
# File 'lib/rbs/ast/ruby/annotations.rb', line 323

def param_type
  @param_type
end

#star2_locationLocation (readonly)

Returns the value of attribute star2_location.

Returns:



323
324
325
# File 'lib/rbs/ast/ruby/annotations.rb', line 323

def star2_location
  @star2_location
end

Instance Method Details

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

Yields:

Yield Parameters:

Yield Returns:

Returns:

  • (self)


334
335
336
337
338
339
340
341
342
343
344
# File 'lib/rbs/ast/ruby/annotations.rb', line 334

def map_type_name(&block)
  self.class.new(
    location:,
    prefix_location:,
    star2_location: star2_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)


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

def name: () -> Symbol?

#type_fingerprintObject

Returns:

  • (Object)


346
347
348
349
350
351
352
353
# File 'lib/rbs/ast/ruby/annotations.rb', line 346

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