* 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)
| 17 | * two apart. |
| 18 | */ |
| 19 | function isRubyClassMethod(node: SyntaxNode): boolean { |
| 20 | if (node.type === 'singleton_method') return true; |
| 21 | if (node.type !== 'method') return false; |
| 22 | let parent = node.parent; |
| 23 | if (parent?.type === 'body_statement') parent = parent.parent; |
| 24 | return parent?.type === 'singleton_class'; |
| 25 | } |
| 26 | |
| 27 | export const rubyExtractor: LanguageExtractor = { |
| 28 | functionTypes: ['method'], |
nothing calls this directly
no outgoing calls
no test coverage detected