Class: SyntaxTree::Undef::UndefArgumentFormatter
- Inherits:
-
Object
- Object
- SyntaxTree::Undef::UndefArgumentFormatter
- Defined in:
- lib/syntax_tree/node.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.
8829 8830 8831 |
# File 'lib/syntax_tree/node.rb', line 8829 def initialize(node) @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
- DynaSymbol | SymbolLiteral
-
the symbol to undefine
8827 8828 8829 |
# File 'lib/syntax_tree/node.rb', line 8827 def node @node end |
Instance Method Details
#comments ⇒ Object
8833 8834 8835 8836 8837 8838 8839 |
# File 'lib/syntax_tree/node.rb', line 8833 def comments if node.is_a?(SymbolLiteral) node.comments + node.value.comments else node.comments end end |
#format(q) ⇒ Object
8841 8842 8843 |
# File 'lib/syntax_tree/node.rb', line 8841 def format(q) node.is_a?(SymbolLiteral) ? q.format(node.value) : q.format(node) end |