Skip to content

Commit 79abb36

Browse files
committed
Ruby: Remove MethodModifier
1 parent 97e9eab commit 79abb36

File tree

1 file changed

+6
-13
lines changed

1 file changed

+6
-13
lines changed

ruby/ql/lib/codeql/ruby/ast/Method.qll

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -66,25 +66,18 @@ class MethodBase extends Callable, BodyStmt, Scope, TMethodBase {
6666
}
6767

6868
/**
69-
* A method call which modifies another method in some way.
69+
* A method call that sets the visibility of other methods.
7070
* For example, `private :foo` makes the method `foo` private.
7171
*/
72-
private class MethodModifier extends MethodCall {
73-
/** Gets the name of the method that this call applies to. */
74-
Expr getMethodArgument() { result = this.getArgument(0) }
75-
}
76-
77-
/** A method call that sets the visibility of other methods. */
78-
private class VisibilityModifier extends MethodModifier {
79-
private Namespace namespace;
80-
private int position;
81-
72+
private class VisibilityModifier extends MethodCall {
8273
VisibilityModifier() {
8374
this.getMethodName() =
84-
["public", "private", "protected", "public_class_method", "private_class_method"] and
85-
namespace.getStmt(position) = this
75+
["public", "private", "protected", "public_class_method", "private_class_method"]
8676
}
8777

78+
/** Gets the name of the method that this call applies to. */
79+
Expr getMethodArgument() { result = this.getArgument(0) }
80+
8881
/**
8982
* Holds if this modifier changes the "ambient" visibility - i.e. the default
9083
* visibility of any subsequent method definitions.

0 commit comments

Comments
 (0)