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

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

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_locationObject (readonly)

Returns the value of attribute colon_location.



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

def colon_location
  @colon_location
end

#comment_locationObject (readonly)

Returns the value of attribute comment_location.



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

def comment_location
  @comment_location
end

#name_locationObject (readonly)

Returns the value of attribute name_location.



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

def name_location
  @name_location
end

#param_typeObject (readonly)

Returns the value of attribute param_type.



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

def param_type
  @param_type
end

#star2_locationObject (readonly)

Returns the value of attribute star2_location.



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

def star2_location
  @star2_location
end

Instance Method Details

#map_type_name(&block) ⇒ Object



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

#type_fingerprintObject



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