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.



1273
1274
1275
# File 'lib/syntax_tree/node.rb', line 1273

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

VarField

the identifier that represents the remaining positionals



1271
1272
1273
# File 'lib/syntax_tree/node.rb', line 1271

def value
  @value
end

Instance Method Details

#commentsObject



1277
1278
1279
# File 'lib/syntax_tree/node.rb', line 1277

def comments
  value.comments
end

#format(q) ⇒ Object



1281
1282
1283
1284
# File 'lib/syntax_tree/node.rb', line 1281

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