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.
8910 8911 8912 8913 |
# File 'lib/syntax_tree.rb', line 8910 def initialize(name, value) @name = name @value = value end |
Instance Attribute Details
#name ⇒ Object (readonly)
- Ident
-
the name of the parameter
8905 8906 8907 |
# File 'lib/syntax_tree.rb', line 8905 def name @name end |
#value ⇒ Object (readonly)
- nil | untyped
-
the value of the parameter
8908 8909 8910 |
# File 'lib/syntax_tree.rb', line 8908 def value @value end |
Instance Method Details
#comments ⇒ Object
8915 8916 8917 |
# File 'lib/syntax_tree.rb', line 8915 def comments [] end |
#format(q) ⇒ Object
8919 8920 8921 8922 8923 8924 8925 8926 |
# File 'lib/syntax_tree.rb', line 8919 def format(q) q.format(name) if value q.text(" ") q.format(value) end end |