Class: SyntaxTree::Params::KeywordFormatter
- Inherits:
-
Object
- Object
- SyntaxTree::Params::KeywordFormatter
- Defined in:
- lib/syntax_tree/node.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.
6539 6540 6541 6542 |
# File 'lib/syntax_tree/node.rb', line 6539 def initialize(name, value) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
- Ident
-
the name of the parameter
6534 6535 6536 |
# File 'lib/syntax_tree/node.rb', line 6534 def name @name end |
#value ⇒ Object (readonly)
- nil | untyped
-
the value of the parameter
6537 6538 6539 |
# File 'lib/syntax_tree/node.rb', line 6537 def value @value end |
Instance Method Details
#comments ⇒ Object
6544 6545 6546 |
# File 'lib/syntax_tree/node.rb', line 6544 def comments [] end |
#format(q) ⇒ Object
6548 6549 6550 6551 6552 6553 6554 6555 |
# File 'lib/syntax_tree/node.rb', line 6548 def format(q) q.format(name) if value q.text(" ") q.format(value) end end |