Class: SyntaxTree::Params::KeywordRestFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_tree/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ KeywordRestFormatter

Returns a new instance of KeywordRestFormatter.



6562
6563
6564
# File 'lib/syntax_tree/node.rb', line 6562

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

:nil | ArgsForward | KwRestParam

the value of the parameter



6560
6561
6562
# File 'lib/syntax_tree/node.rb', line 6560

def value
  @value
end

Instance Method Details

#commentsObject



6566
6567
6568
# File 'lib/syntax_tree/node.rb', line 6566

def comments
  []
end

#format(q) ⇒ Object



6570
6571
6572
6573
6574
6575
6576
# File 'lib/syntax_tree/node.rb', line 6570

def format(q)
  if value == :nil
    q.text("**nil")
  else
    q.format(value)
  end
end