Class: SyntaxTree::RBS::MethodSignature::OptionalKeyword
- Inherits:
-
Object
- Object
- SyntaxTree::RBS::MethodSignature::OptionalKeyword
- Defined in:
- lib/syntax_tree/rbs/utils.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#param ⇒ Object
readonly
Returns the value of attribute param.
Instance Method Summary collapse
- #format(q) ⇒ Object
-
#initialize(name, param) ⇒ OptionalKeyword
constructor
A new instance of OptionalKeyword.
Constructor Details
#initialize(name, param) ⇒ OptionalKeyword
Returns a new instance of OptionalKeyword.
273 274 275 276 |
# File 'lib/syntax_tree/rbs/utils.rb', line 273 def initialize(name, param) @name = name @param = param end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
271 272 273 |
# File 'lib/syntax_tree/rbs/utils.rb', line 271 def name @name end |
#param ⇒ Object (readonly)
Returns the value of attribute param.
271 272 273 |
# File 'lib/syntax_tree/rbs/utils.rb', line 271 def param @param end |
Instance Method Details
#format(q) ⇒ Object
278 279 280 281 282 283 |
# File 'lib/syntax_tree/rbs/utils.rb', line 278 def format(q) q.text("?") q.text(name) q.text(": ") param.format(q) end |