Class: SyntaxTree::Params::OptionalFormatter
- Inherits:
-
Object
- Object
- SyntaxTree::Params::OptionalFormatter
- Defined in:
- lib/syntax_tree.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.
8887 8888 8889 8890 |
# File 'lib/syntax_tree.rb', line 8887 def initialize(name, value) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
- Ident
-
the name of the parameter
8882 8883 8884 |
# File 'lib/syntax_tree.rb', line 8882 def name @name end |
#value ⇒ Object (readonly)
- untyped
-
the value of the parameter
8885 8886 8887 |
# File 'lib/syntax_tree.rb', line 8885 def value @value end |
Instance Method Details
#comments ⇒ Object
8892 8893 8894 |
# File 'lib/syntax_tree.rb', line 8892 def comments [] end |
#format(q) ⇒ Object
8896 8897 8898 8899 8900 |
# File 'lib/syntax_tree.rb', line 8896 def format(q) q.format(name) q.text(" = ") q.format(value) end |