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.
8442 8443 8444 8445 |
# File 'lib/syntax_tree.rb', line 8442 def initialize(name, value) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
- Ident
-
the name of the parameter
8437 8438 8439 |
# File 'lib/syntax_tree.rb', line 8437 def name @name end |
#value ⇒ Object (readonly)
- nil | untyped
-
the value of the parameter
8440 8441 8442 |
# File 'lib/syntax_tree.rb', line 8440 def value @value end |
Instance Method Details
#comments ⇒ Object
8447 8448 8449 |
# File 'lib/syntax_tree.rb', line 8447 def comments [] end |
#format(q) ⇒ Object
8451 8452 8453 8454 8455 8456 8457 8458 |
# File 'lib/syntax_tree.rb', line 8451 def format(q) q.format(name) if value q.text(" ") q.format(value) end end |