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.
330 331 332 |
# File 'lib/syntax_tree/node.rb', line 330 def initialize(argument) @argument = argument end |
Instance Attribute Details
#argument ⇒ Object (readonly)
- DynaSymbol | SymbolLiteral
-
the argument being passed to alias
328 329 330 |
# File 'lib/syntax_tree/node.rb', line 328 def argument @argument end |
Instance Method Details
#comments ⇒ Object
334 335 336 337 338 339 340 |
# File 'lib/syntax_tree/node.rb', line 334 def comments if argument.is_a?(SymbolLiteral) argument.comments + argument.value.comments else argument.comments end end |
#format(q) ⇒ Object
342 343 344 345 346 347 348 |
# File 'lib/syntax_tree/node.rb', line 342 def format(q) if argument.is_a?(SymbolLiteral) q.format(argument.value) else q.format(argument) end end |