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
Returns a new instance of OptionalFormatter.
8089 8090 8091 8092 |
# File 'lib/syntax_tree/node.rb', line 8089 def initialize(name, value) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
- Ident
-
the name of the parameter
8084 8085 8086 |
# File 'lib/syntax_tree/node.rb', line 8084 def name @name end |
#value ⇒ Object (readonly)
- untyped
-
the value of the parameter
8087 8088 8089 |
# File 'lib/syntax_tree/node.rb', line 8087 def value @value end |
Instance Method Details
#comments ⇒ Object
8094 8095 8096 |
# File 'lib/syntax_tree/node.rb', line 8094 def comments [] end |
#format(q) ⇒ Object
8098 8099 8100 8101 8102 |
# File 'lib/syntax_tree/node.rb', line 8098 def format(q) q.format(name) q.text(" = ") q.format(value) end |