Class: SyntaxTree::AryPtn::RestFormatter

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

Overview

Formats the optional splat of an array pattern.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ RestFormatter

Returns a new instance of RestFormatter.



1288
1289
1290
# File 'lib/syntax_tree/node.rb', line 1288

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

VarField

the identifier that represents the remaining positionals



1286
1287
1288
# File 'lib/syntax_tree/node.rb', line 1286

def value
  @value
end

Instance Method Details

#commentsObject



1292
1293
1294
# File 'lib/syntax_tree/node.rb', line 1292

def comments
  value.comments
end

#format(q) ⇒ Object



1296
1297
1298
1299
# File 'lib/syntax_tree/node.rb', line 1296

def format(q)
  q.text("*")
  q.format(value)
end