From 64ebf5b90962d5b717d16e6aba70de80fceb97d2 Mon Sep 17 00:00:00 2001 From: Arthur Baars Date: Wed, 25 Nov 2020 12:55:53 +0100 Subject: [PATCH] Address comments --- ql/src/codeql_ruby/Variables.qll | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ql/src/codeql_ruby/Variables.qll b/ql/src/codeql_ruby/Variables.qll index d7171c78b53..ee1d6aa9751 100644 --- a/ql/src/codeql_ruby/Variables.qll +++ b/ql/src/codeql_ruby/Variables.qll @@ -15,8 +15,8 @@ private VariableScope enclosingScope(AstNode node) { /** A parameter. */ class Parameter extends AstNode { - int position; - VariableScope scope; + private int position; + private VariableScope scope; Parameter() { this = @@ -26,10 +26,13 @@ class Parameter extends AstNode { scope.(MethodScope).getScopeElement().getAFieldOrChild().(MethodParameters).getChild(position) } + /** Gets the (zero-based) position of this parameter. */ final int getPosition() { result = position } + /** Gets the scope this parameter is declared in. */ final VariableScope getDeclaringScope() { result = scope } + /** Gets an access to this parameter. */ final ParameterAccess getAnAccess() { result.getParameter() = this } }