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



1090
1091
1092
# File 'lib/syntax_tree/node.rb', line 1090

def initialize(value)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

VarField

the identifier that represents the remaining positionals



1088
1089
1090
# File 'lib/syntax_tree/node.rb', line 1088

def value
  @value
end

Instance Method Details

#commentsObject



1094
1095
1096
# File 'lib/syntax_tree/node.rb', line 1094

def comments
  value.comments
end

#format(q) ⇒ Object



1098
1099
1100
1101
# File 'lib/syntax_tree/node.rb', line 1098

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