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.
5919 5920 5921 |
# File 'lib/syntax_tree/node.rb', line 5919 def initialize(keyword_rest) @keyword_rest = keyword_rest end |
Instance Attribute Details
#keyword_rest ⇒ Object (readonly)
- VarField
-
the parameter that matches the remaining keywords
5917 5918 5919 |
# File 'lib/syntax_tree/node.rb', line 5917 def keyword_rest @keyword_rest end |
Instance Method Details
#comments ⇒ Object
5923 5924 5925 |
# File 'lib/syntax_tree/node.rb', line 5923 def comments [] end |
#format(q) ⇒ Object
5927 5928 5929 5930 |
# File 'lib/syntax_tree/node.rb', line 5927 def format(q) q.text("**") q.format(keyword_rest) end |