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

Returns a new instance of KeywordRestFormatter.



8271
8272
8273
# File 'lib/syntax_tree/node.rb', line 8271

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

:nil | ArgsForward | KwRestParam

the value of the parameter



8269
8270
8271
# File 'lib/syntax_tree/node.rb', line 8269

def value
  @value
end

Instance Method Details

#commentsObject



8275
8276
8277
# File 'lib/syntax_tree/node.rb', line 8275

def comments
  []
end

#format(q) ⇒ Object



8279
8280
8281
# File 'lib/syntax_tree/node.rb', line 8279

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