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.



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

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

  super(node.location)
end

Instance Attribute Details

#commentsObject (readonly)

: AnnotationParser::ParsingResult?



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

def comments
  @comments
end

#nodeObject (readonly)

: Prism::AliasMethodNode



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

def node
  @node
end

Instance Method Details

#new_nameObject



336
337
338
339
340
# File 'lib/rbs/inline/ast/members.rb', line 336

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



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

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