isRubyClassMethod (languages/ruby.ts): `def self.x` / `def Widget.x` (a singleton_method), or a `def` inside `class << self`.
(node: Node)
| 1169 | /// isRubyClassMethod (languages/ruby.ts): `def self.x` / `def Widget.x` (a |
| 1170 | /// singleton_method), or a `def` inside `class << self`. |
| 1171 | fn is_class_method(node: Node) -> bool { |
| 1172 | match node.kind() { |
| 1173 | "singleton_method" => true, |
| 1174 | "method" => { |
| 1175 | let mut parent = node.parent(); |
| 1176 | if parent.map_or(false, |p| p.kind() == "body_statement") { |
| 1177 | parent = parent.and_then(|p| p.parent()); |
| 1178 | } |
| 1179 | parent.map_or(false, |p| p.kind() == "singleton_class") |
| 1180 | } |
| 1181 | _ => false, |
| 1182 | } |
| 1183 | } |
| 1184 | |
| 1185 | /// The Ruby `call` node whose argument_list (or keyword pair) contains `node` |
| 1186 | /// — nearest `call` ancestor within 4 parent hops (function-ref.ts:837). |
no outgoing calls
no test coverage detected