Class: SyntaxTree::Params::KeywordRestFormatter
- Inherits:
-
Object
- Object
- SyntaxTree::Params::KeywordRestFormatter
- Defined in:
- lib/syntax_tree/node.rb
Overview
Formats the keyword_rest position of the parameters. This can be the **nil syntax, the … syntax, or the ** syntax.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
- :nil | ArgsForward | KwRestParam
-
the value of the parameter.
Instance Method Summary collapse
- #comments ⇒ Object
- #format(q) ⇒ Object
-
#initialize(value) ⇒ KeywordRestFormatter
constructor
A new instance of KeywordRestFormatter.
Constructor Details
#initialize(value) ⇒ KeywordRestFormatter
Returns a new instance of KeywordRestFormatter.
6846 6847 6848 |
# File 'lib/syntax_tree/node.rb', line 6846 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
- :nil | ArgsForward | KwRestParam
-
the value of the parameter
6844 6845 6846 |
# File 'lib/syntax_tree/node.rb', line 6844 def value @value end |
Instance Method Details
#comments ⇒ Object
6850 6851 6852 |
# File 'lib/syntax_tree/node.rb', line 6850 def comments [] end |
#format(q) ⇒ Object
6854 6855 6856 |
# File 'lib/syntax_tree/node.rb', line 6854 def format(q) value == :nil ? q.text("**nil") : q.format(value) end |