123456789_123456789_123456789_123456789_123456789_

Class: RBS::AST::Ruby::Annotations::InstanceVariableAnnotation

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:, ivar_name:, ivar_name_location:, colon_location:, type:, comment_location:) ⇒ InstanceVariableAnnotation

[ GitHub ]

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

def initialize(location:, prefix_location:, ivar_name:, ivar_name_location:, colon_location:, type:, comment_location:)
  super(location, prefix_location)
  @ivar_name = ivar_name
  @ivar_name_location = ivar_name_location
  @colon_location = colon_location
  @type = type
  @comment_location = comment_location
end

Instance Attribute Details

#colon_location (readonly)

[ GitHub ]

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

attr_reader :ivar_name, :ivar_name_location, :colon_location, :type, :comment_location

#comment_location (readonly)

[ GitHub ]

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

attr_reader :ivar_name, :ivar_name_location, :colon_location, :type, :comment_location

#ivar_name (readonly)

[ GitHub ]

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

attr_reader :ivar_name, :ivar_name_location, :colon_location, :type, :comment_location

#ivar_name_location (readonly)

[ GitHub ]

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

attr_reader :ivar_name, :ivar_name_location, :colon_location, :type, :comment_location

#type (readonly)

[ GitHub ]

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

attr_reader :ivar_name, :ivar_name_location, :colon_location, :type, :comment_location

Instance Method Details

#map_type_name(&block)

[ GitHub ]

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

def map_type_name(&block)
  self.class.new(
    location:,
    prefix_location:,
    ivar_name:,
    ivar_name_location:,
    colon_location:,
    type: type.map_type_name { yield _1 },
    comment_location:
  ) #: self
end

#type_fingerprint

[ GitHub ]

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

def type_fingerprint
  [
    "annots/instance_variable",
    ivar_name.to_s,
    type.to_s,
    comment_location&.source
  ]
end