* A class method: `def self.x` or `def Widget.x` (a singleton_method), or a * `def` inside `class << self`. It shares its qualified name with an instance * method of the same name (`Widget::build` for both), so only this tells the * two apart.
(node: SyntaxNode)
| 9 | * two apart. |
| 10 | */ |
| 11 | function isRubyClassMethod(node: SyntaxNode): boolean { |
| 12 | if (node.type === 'singleton_method') return true; |
| 13 | if (node.type !== 'method') return false; |
| 14 | let parent = node.parent; |
| 15 | if (parent?.type === 'body_statement') parent = parent.parent; |
| 16 | return parent?.type === 'singleton_class'; |
| 17 | } |
| 18 | |
| 19 | export const rubyExtractor: LanguageExtractor = { |
| 20 | functionTypes: ['method'], |
nothing calls this directly
no outgoing calls
no test coverage detected