Class: SyntaxTree::Params::KeywordRestFormatter

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

Overview

Formats the keyword_rest position of the parameters. This can be the **nil syntax, the … syntax, or the ** syntax.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ KeywordRestFormatter



8148
8149
8150
# File 'lib/syntax_tree/node.rb', line 8148

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

:nil | ArgsForward | KwRestParam

the value of the parameter



8146
8147
8148
# File 'lib/syntax_tree/node.rb', line 8146

def value
  @value
end

Instance Method Details

#commentsObject



8152
8153
8154
# File 'lib/syntax_tree/node.rb', line 8152

def comments
  []
end

#format(q) ⇒ Object



8156
8157
8158
# File 'lib/syntax_tree/node.rb', line 8156

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