Class: SyntaxTree::Params::OptionalFormatter
- Inherits:
-
Object
- Object
- SyntaxTree::Params::OptionalFormatter
- Defined in:
- lib/syntax_tree/node.rb
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.
5974 5975 5976 5977 |
# File 'lib/syntax_tree/node.rb', line 5974 def initialize(name, value) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
- Ident
-
the name of the parameter
5969 5970 5971 |
# File 'lib/syntax_tree/node.rb', line 5969 def name @name end |
#value ⇒ Object (readonly)
- untyped
-
the value of the parameter
5972 5973 5974 |
# File 'lib/syntax_tree/node.rb', line 5972 def value @value end |
Instance Method Details
#comments ⇒ Object
5979 5980 5981 |
# File 'lib/syntax_tree/node.rb', line 5979 def comments [] end |
#format(q) ⇒ Object
5983 5984 5985 5986 5987 |
# File 'lib/syntax_tree/node.rb', line 5983 def format(q) q.format(name) q.text(" = ") q.format(value) end |