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.
5022 5023 5024 |
# File 'lib/syntax_tree/node.rb', line 5022 def initialize(keyword_rest) @keyword_rest = keyword_rest end |
Instance Attribute Details
#keyword_rest ⇒ Object (readonly)
- VarField
-
the parameter that matches the remaining keywords
5020 5021 5022 |
# File 'lib/syntax_tree/node.rb', line 5020 def keyword_rest @keyword_rest end |
Instance Method Details
#comments ⇒ Object
5026 5027 5028 |
# File 'lib/syntax_tree/node.rb', line 5026 def comments [] end |
#format(q) ⇒ Object
5030 5031 5032 5033 |
# File 'lib/syntax_tree/node.rb', line 5030 def format(q) q.text("**") q.format(keyword_rest) end |