Class: RBS::Types::Function::Param
- Inherits:
-
Object
- Object
- RBS::Types::Function::Param
- Defined in:
- lib/syntax_tree/rbs/types.rb
Instance Method Summary collapse
Instance Method Details
#format(q) ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/syntax_tree/rbs/types.rb', line 74 def format(q) type.format(q) if name q.text(" ") if Parser::KEYWORDS.include?(name.to_s) q.text("`#{name}`") else q.text(name) end end end |
#pretty_print(q) ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/syntax_tree/rbs/types.rb', line 88 def pretty_print(q) q.group(2, "(param", ")") do q.breakable q.text("type=") q.pp(type) if name q.breakable q.text("name=") q.pp(name) end end end |