123456789_123456789_123456789_123456789_123456789_

Class: RBS::AST::Ruby::Annotations::NodeTypeAssertion

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

Base - Inherited

Instance Method Summary

Constructor Details

.new(location:, prefix_location:, type:) ⇒ NodeTypeAssertion

[ GitHub ]

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

def initialize(location:, prefix_location:, type:)
  super(location, prefix_location)
  @type = type
end

Instance Attribute Details

#type (readonly)

[ GitHub ]

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

attr_reader :type

Instance Method Details

#map_type_name

[ GitHub ]

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

def map_type_name
  self.class.new(
    location:, prefix_location:,
    type: type.map_type_name { yield _1 }
  ) #: self
end

#type_fingerprint

[ GitHub ]

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

def type_fingerprint
  [
    "annots/node_type_assertion",
    type.to_s
  ]
end