Class: SyntaxTree::Undef::UndefArgumentFormatter
- Inherits:
-
Object
- Object
- SyntaxTree::Undef::UndefArgumentFormatter
- Defined in:
- lib/syntax_tree/node.rb
Overview
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.
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.
11232 11233 11234 |
# File 'lib/syntax_tree/node.rb', line 11232 def initialize(node) @node = node end |
Instance Attribute Details
#node ⇒ Object (readonly)
- DynaSymbol | SymbolLiteral
-
the symbol to undefine
11230 11231 11232 |
# File 'lib/syntax_tree/node.rb', line 11230 def node @node end |
Instance Method Details
#comments ⇒ Object
11236 11237 11238 11239 11240 11241 11242 |
# 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) ⇒ Object
11244 11245 11246 |
# File 'lib/syntax_tree/node.rb', line 11244 def format(q) node.is_a?(SymbolLiteral) ? q.format(node.value) : q.format(node) end |