123456789_123456789_123456789_123456789_123456789_

Class: RBS::AST::Ruby::Annotations::TypeApplicationAnnotation

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Base
Instance Chain:
self, Base
Inherits: RBS::AST::Ruby::Annotations::Base
Defined in: lib/rbs/ast/ruby/annotations.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(location:, prefix_location:, type_args:, close_bracket_location:, comma_locations:) ⇒ TypeApplicationAnnotation

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/annotations.rb', line 195

def initialize(location:, prefix_location:, type_args:, close_bracket_location:, comma_locations:)
  super(location, prefix_location)
  @type_args = type_args
  @close_bracket_location = close_bracket_location
  @comma_locations = comma_locations
end

Instance Attribute Details

#close_bracket_location (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/annotations.rb', line 193

attr_reader :type_args, :close_bracket_location, :comma_locations

#comma_locations (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/annotations.rb', line 193

attr_reader :type_args, :close_bracket_location, :comma_locations

#type_args (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/annotations.rb', line 193

attr_reader :type_args, :close_bracket_location, :comma_locations

Instance Method Details

#map_type_name(&block)

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/annotations.rb', line 202

def map_type_name(&block)
  mapped_type_args = type_args.map { |type| type.map_type_name { yield _1 } }

  self.class.new(
    location:,
    prefix_location:,
    type_args: mapped_type_args,
    close_bracket_location:,
    comma_locations:
  ) #: self
end

#type_fingerprint

[ GitHub ]

  
# File 'lib/rbs/ast/ruby/annotations.rb', line 214

def type_fingerprint
  [
    "annots/type_application",
    type_args.map(&:to_s)
  ]
end