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.



1034
1035
1036
# File 'lib/syntax_tree/node.rb', line 1034

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

VarField

the identifier that represents the remaining positionals



1032
1033
1034
# File 'lib/syntax_tree/node.rb', line 1032

def value
  @value
end

Instance Method Details

#commentsObject



1038
1039
1040
# File 'lib/syntax_tree/node.rb', line 1038

def comments
  value.comments
end

#format(q) ⇒ Object



1042
1043
1044
1045
# File 'lib/syntax_tree/node.rb', line 1042

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