Class: RBS::Inline::AST::Members::RubyAlias

Inherits:
RubyBase show all
Defined in:
lib/rbs/inline/ast/members.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#location

Instance Method Summary collapse

Methods inherited from Base

#start_line

Constructor Details

#initialize(node, comments) ⇒ RubyAlias

Returns a new instance of RubyAlias.



314
315
316
317
318
319
# File 'lib/rbs/inline/ast/members.rb', line 314

def initialize(node, comments) #: void
  @node = node
  @comments = comments

  super(node.location)
end

Instance Attribute Details

#commentsObject (readonly)

: AnnotationParser::ParsingResult?



310
311
312
# File 'lib/rbs/inline/ast/members.rb', line 310

def comments
  @comments
end

#nodeObject (readonly)

: Prism::AliasMethodNode



309
310
311
# File 'lib/rbs/inline/ast/members.rb', line 309

def node
  @node
end

Instance Method Details

#new_nameObject



329
330
331
332
333
# File 'lib/rbs/inline/ast/members.rb', line 329

def new_name
  raise unless node.new_name.is_a?(Prism::SymbolNode)
  value = node.new_name.value or raise
  value.to_sym
end

#old_nameObject



322
323
324
325
326
# File 'lib/rbs/inline/ast/members.rb', line 322

def old_name
  raise unless node.old_name.is_a?(Prism::SymbolNode)
  value = node.old_name.value or raise
  value.to_sym
end