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.
11659 11660 11661 |
# File 'lib/syntax_tree.rb', line 11659 def initialize(node) @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
- DynaSymbol | SymbolLiteral
-
the symbol to undefine
11657 11658 11659 |
# File 'lib/syntax_tree.rb', line 11657 def node @node end |
Instance Method Details
#comments ⇒ Object
11663 11664 11665 11666 11667 11668 11669 |
# File 'lib/syntax_tree.rb', line 11663 def comments if node.is_a?(SymbolLiteral) node.comments + node.value.comments else node.comments end end |
#format(q) ⇒ Object
11671 11672 11673 |
# File 'lib/syntax_tree.rb', line 11671 def format(q) node.is_a?(SymbolLiteral) ? q.format(node.value) : q.format(node) end |