CodeQL library for Ruby
codeql/ruby-all 0.8.15-dev (changelog, source)
Search

Member predicate API::Node::getMethod

Gets a call to method with this value as the receiver, or the definition of method on an object that can reach this sink.

If the receiver represents a module or class object, this includes calls on descendents of that module or class.

For example:

# API::getTopLevelMember("Foo").getMethod("bar")
Foo.bar

# API::getTopLevelMember("Foo").getInstance().getMethod("bar")
Foo.new.bar

class B < Foo
end
B.bar # API::getTopLevelMember("Foo").getMethod("bar")

class C
  def m # API::getTopLevelMember("Foo").getMethod("bar").getArgument(0).getMethod("m")
  end
end
Foo.bar(C.new)
Node getMethod(string method)