Class: RBS::AST::Ruby::Annotations::AliasAnnotation

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

Direct Known Subclasses

ClassAliasAnnotation, ModuleAliasAnnotation

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:, keyword_location:, type_name:, type_name_location:) ⇒ AliasAnnotation

Returns a new instance of AliasAnnotation.



46
47
48
49
50
51
# File 'lib/rbs/ast/ruby/annotations.rb', line 46

def initialize(location:, prefix_location:, keyword_location:, type_name:, type_name_location:)
  super(location, prefix_location)
  @keyword_location = keyword_location
  @type_name = type_name
  @type_name_location = type_name_location
end

Instance Attribute Details

#keyword_locationObject (readonly)

Returns the value of attribute keyword_location.



44
45
46
# File 'lib/rbs/ast/ruby/annotations.rb', line 44

def keyword_location
  @keyword_location
end

#type_nameObject (readonly)

Returns the value of attribute type_name.



44
45
46
# File 'lib/rbs/ast/ruby/annotations.rb', line 44

def type_name
  @type_name
end

#type_name_locationObject (readonly)

Returns the value of attribute type_name_location.



44
45
46
# File 'lib/rbs/ast/ruby/annotations.rb', line 44

def type_name_location
  @type_name_location
end

Instance Method Details

#map_type_nameObject



53
54
55
56
57
58
59
60
61
# File 'lib/rbs/ast/ruby/annotations.rb', line 53

def map_type_name
  self.class.new(
    location:,
    prefix_location:,
    keyword_location:,
    type_name: type_name ? yield(type_name) : nil,
    type_name_location:
  ) #: self
end