Class: SyntaxTree::Undef::UndefArgumentFormatter
- Inherits:
-
Object
- Object
- SyntaxTree::Undef::UndefArgumentFormatter
- Defined in:
- lib/syntax_tree.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
- DynaSymbol | SymbolLiteral
-
the symbol to undefine.
Instance Method Summary collapse
- #comments ⇒ Object
- #format(q) ⇒ Object
-
#initialize(node) ⇒ UndefArgumentFormatter
constructor
A new instance of UndefArgumentFormatter.
Constructor Details
#initialize(node) ⇒ UndefArgumentFormatter
Returns a new instance of UndefArgumentFormatter.
12375 12376 12377 |
# File 'lib/syntax_tree.rb', line 12375 def initialize(node) @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
- DynaSymbol | SymbolLiteral
-
the symbol to undefine
12373 12374 12375 |
# File 'lib/syntax_tree.rb', line 12373 def node @node end |
Instance Method Details
#comments ⇒ Object
12379 12380 12381 12382 12383 12384 12385 |
# File 'lib/syntax_tree.rb', line 12379 def comments if node.is_a?(SymbolLiteral) node.comments + node.value.comments else node.comments end end |
#format(q) ⇒ Object
12387 12388 12389 |
# File 'lib/syntax_tree.rb', line 12387 def format(q) node.is_a?(SymbolLiteral) ? q.format(node.value) : q.format(node) end |