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.
5997 5998 5999 6000 |
# File 'lib/syntax_tree/node.rb', line 5997 def initialize(name, value) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
- Ident
-
the name of the parameter
5992 5993 5994 |
# File 'lib/syntax_tree/node.rb', line 5992 def name @name end |
#value ⇒ Object (readonly)
- nil | untyped
-
the value of the parameter
5995 5996 5997 |
# File 'lib/syntax_tree/node.rb', line 5995 def value @value end |
Instance Method Details
#comments ⇒ Object
6002 6003 6004 |
# File 'lib/syntax_tree/node.rb', line 6002 def comments [] end |
#format(q) ⇒ Object
6006 6007 6008 6009 6010 6011 6012 6013 |
# File 'lib/syntax_tree/node.rb', line 6006 def format(q) q.format(name) if value q.text(" ") q.format(value) end end |