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.



6020
6021
6022
# File 'lib/syntax_tree/node.rb', line 6020

def initialize(value)
  @value = value
end

Instance Attribute Details

#value ⇒ Object (readonly)

[:nil | ArgsForward | KwRestParam] the value of the parameter



6018
6019
6020
# File 'lib/syntax_tree/node.rb', line 6018

def value
  @value
end

Instance Method Details

#comments ⇒ Object



6024
6025
6026
# File 'lib/syntax_tree/node.rb', line 6024

def comments
  []
end

#format(q) ⇒ Object



6028
6029
6030
6031
6032
6033
6034
# File 'lib/syntax_tree/node.rb', line 6028

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