mirror of
https://github.com/github/codeql.git
synced 2025-12-20 10:46:30 +01:00
`Module#private_class_method` takes a symbol representing the name of a
method in the current module scope and makes that module private. This
is similar to `private`, but applies only to class (singleton) methods.
Unlike `private`, it must be called with an argument, and does not
change the ambient visibility for any subsequent method definitions.
class Foo
def public
end
def private1
end
private_class_method :private1
# This alternate form works because method definition
# returns its name as a symbol:
private_class_method def private2
end
end
8 lines
220 B
Plaintext
8 lines
220 B
Plaintext
import ruby
|
|
|
|
query Callable getTarget(Call call) { result = call.getATarget() }
|
|
|
|
query predicate unresolvedCall(Call call) { not exists(call.getATarget()) }
|
|
|
|
query predicate privateMethod(MethodBase m) { m.isPrivate() }
|