class SyntaxTree::AliasNode::AliasArgumentFormatter

Formats an argument to the alias keyword. For symbol literals it uses the value of the symbol directly to look like bare words.

Attributes

argument[R]
Backref | DynaSymbol | GVar | SymbolLiteral

the argument being passed

to alias

Public Class Methods

new(argument) click to toggle source
# File lib/syntax_tree/node.rb, line 466
def initialize(argument)
  @argument = argument
end

Public Instance Methods

comments() click to toggle source
# File lib/syntax_tree/node.rb, line 470
def comments
  if argument.is_a?(SymbolLiteral)
    argument.comments + argument.value.comments
  else
    argument.comments
  end
end
format(q) click to toggle source
# File lib/syntax_tree/node.rb, line 478
def format(q)
  if argument.is_a?(SymbolLiteral)
    q.format(argument.value)
  else
    q.format(argument)
  end
end