class SyntaxTree::Undef::UndefArgumentFormatter

Undef accepts a variable number of arguments that can be either DynaSymbol or SymbolLiteral objects. For SymbolLiteral objects we descend directly into the value in order to have it come out as bare words.

Attributes

node[R]
DynaSymbol | SymbolLiteral

the symbol to undefine

Public Class Methods

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

Public Instance Methods

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