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.



1319
1320
1321
# File 'lib/syntax_tree/node.rb', line 1319

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

VarField

the identifier that represents the remaining positionals



1317
1318
1319
# File 'lib/syntax_tree/node.rb', line 1317

def value
  @value
end

Instance Method Details

#commentsObject



1323
1324
1325
# File 'lib/syntax_tree/node.rb', line 1323

def comments
  value.comments
end

#format(q) ⇒ Object



1327
1328
1329
1330
# File 'lib/syntax_tree/node.rb', line 1327

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