Class: SyntaxTree::Alias::AliasArgumentFormatter
- Inherits:
-
Object
- Object
- SyntaxTree::Alias::AliasArgumentFormatter
- Defined in:
- lib/syntax_tree/node.rb
Instance Attribute Summary collapse
-
#argument ⇒ Object
readonly
- DynaSymbol | SymbolLiteral
-
the argument being passed to alias.
Instance Method Summary collapse
- #comments ⇒ Object
- #format(q) ⇒ Object
-
#initialize(argument) ⇒ AliasArgumentFormatter
constructor
A new instance of AliasArgumentFormatter.
Constructor Details
#initialize(argument) ⇒ AliasArgumentFormatter
Returns a new instance of AliasArgumentFormatter.
315 316 317 |
# File 'lib/syntax_tree/node.rb', line 315 def initialize(argument) @argument = argument end |
Instance Attribute Details
#argument ⇒ Object (readonly)
- DynaSymbol | SymbolLiteral
-
the argument being passed to alias
313 314 315 |
# File 'lib/syntax_tree/node.rb', line 313 def argument @argument end |
Instance Method Details
#comments ⇒ Object
319 320 321 322 323 324 325 |
# File 'lib/syntax_tree/node.rb', line 319 def comments if argument.is_a?(SymbolLiteral) argument.comments + argument.value.comments else argument.comments end end |
#format(q) ⇒ Object
327 328 329 330 331 332 333 |
# File 'lib/syntax_tree/node.rb', line 327 def format(q) if argument.is_a?(SymbolLiteral) q.format(argument.value) else q.format(argument) end end |