Class: SyntaxTree::Params::KeywordFormatter
- Inherits:
-
Object
- Object
- SyntaxTree::Params::KeywordFormatter
- Defined in:
- lib/syntax_tree.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
- Ident
-
the name of the parameter.
-
#value ⇒ Object
readonly
- nil | untyped
-
the value of the parameter.
Instance Method Summary collapse
- #comments ⇒ Object
- #format(q) ⇒ Object
-
#initialize(name, value) ⇒ KeywordFormatter
constructor
A new instance of KeywordFormatter.
Constructor Details
#initialize(name, value) ⇒ KeywordFormatter
Returns a new instance of KeywordFormatter.
8833 8834 8835 8836 |
# File 'lib/syntax_tree.rb', line 8833 def initialize(name, value) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
- Ident
-
the name of the parameter
8828 8829 8830 |
# File 'lib/syntax_tree.rb', line 8828 def name @name end |
#value ⇒ Object (readonly)
- nil | untyped
-
the value of the parameter
8831 8832 8833 |
# File 'lib/syntax_tree.rb', line 8831 def value @value end |
Instance Method Details
#comments ⇒ Object
8838 8839 8840 |
# File 'lib/syntax_tree.rb', line 8838 def comments [] end |
#format(q) ⇒ Object
8842 8843 8844 8845 8846 8847 8848 8849 |
# File 'lib/syntax_tree.rb', line 8842 def format(q) q.format(name) if value q.text(" ") q.format(value) end end |