Class: SyntaxTree::Params::OptionalFormatter
- Inherits:
-
Object
- Object
- SyntaxTree::Params::OptionalFormatter
- Defined in:
- lib/syntax_tree/node.rb
Overview
Formats the optional position of the parameters. This includes the label, as well as the default value.
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
- Ident
-
the name of the parameter.
-
#value ⇒ Object
readonly
- untyped
-
the value of the parameter.
Instance Method Summary collapse
- #comments ⇒ Object
- #format(q) ⇒ Object
-
#initialize(name, value) ⇒ OptionalFormatter
constructor
A new instance of OptionalFormatter.
Constructor Details
#initialize(name, value) ⇒ OptionalFormatter
6618 6619 6620 6621 |
# File 'lib/syntax_tree/node.rb', line 6618 def initialize(name, value) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
- Ident
-
the name of the parameter
6613 6614 6615 |
# File 'lib/syntax_tree/node.rb', line 6613 def name @name end |
#value ⇒ Object (readonly)
- untyped
-
the value of the parameter
6616 6617 6618 |
# File 'lib/syntax_tree/node.rb', line 6616 def value @value end |
Instance Method Details
#comments ⇒ Object
6623 6624 6625 |
# File 'lib/syntax_tree/node.rb', line 6623 def comments [] end |
#format(q) ⇒ Object
6627 6628 6629 6630 6631 |
# File 'lib/syntax_tree/node.rb', line 6627 def format(q) q.format(name) q.text(" = ") q.format(value) end |