Class: SyntaxTree::Undef::UndefArgumentFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_tree/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node) ⇒ UndefArgumentFormatter

Returns a new instance of UndefArgumentFormatter.



10098
10099
10100
# File 'lib/syntax_tree/node.rb', line 10098

def initialize(node)
  @node = node
end

Instance Attribute Details

#nodeObject (readonly)

[DynaSymbol | SymbolLiteral] the symbol to undefine



10096
10097
10098
# File 'lib/syntax_tree/node.rb', line 10096

def node
  @node
end

Instance Method Details

#commentsObject



10102
10103
10104
10105
10106
10107
10108
# File 'lib/syntax_tree/node.rb', line 10102

def comments
  if node.is_a?(SymbolLiteral)
    node.comments + node.value.comments
  else
    node.comments
  end
end

#format(q) ⇒ Object



10110
10111
10112
# File 'lib/syntax_tree/node.rb', line 10110

def format(q)
  node.is_a?(SymbolLiteral) ? q.format(node.value) : q.format(node)
end