Class: SyntaxTree::HshPtn::KeywordRestFormatter
- Inherits:
-
Object
- Object
- SyntaxTree::HshPtn::KeywordRestFormatter
- Defined in:
- lib/syntax_tree/node.rb
Overview
Formats the optional double-splat from the pattern.
Instance Attribute Summary collapse
-
#keyword_rest ⇒ Object
readonly
- VarField
-
the parameter that matches the remaining keywords.
Instance Method Summary collapse
- #comments ⇒ Object
- #format(q) ⇒ Object
-
#initialize(keyword_rest) ⇒ KeywordRestFormatter
constructor
A new instance of KeywordRestFormatter.
Constructor Details
#initialize(keyword_rest) ⇒ KeywordRestFormatter
Returns a new instance of KeywordRestFormatter.
6027 6028 6029 |
# File 'lib/syntax_tree/node.rb', line 6027 def initialize(keyword_rest) @keyword_rest = keyword_rest end |
Instance Attribute Details
#keyword_rest ⇒ Object (readonly)
- VarField
-
the parameter that matches the remaining keywords
6025 6026 6027 |
# File 'lib/syntax_tree/node.rb', line 6025 def keyword_rest @keyword_rest end |
Instance Method Details
#comments ⇒ Object
6031 6032 6033 |
# File 'lib/syntax_tree/node.rb', line 6031 def comments [] end |
#format(q) ⇒ Object
6035 6036 6037 6038 |
# File 'lib/syntax_tree/node.rb', line 6035 def format(q) q.text("**") q.format(keyword_rest) end |