diff --git a/ruby/ql/lib/codeql/ruby/ast/Constant.qll b/ruby/ql/lib/codeql/ruby/ast/Constant.qll index 187295d443b..a5a48a04ed4 100644 --- a/ruby/ql/lib/codeql/ruby/ast/Constant.qll +++ b/ruby/ql/lib/codeql/ruby/ast/Constant.qll @@ -170,6 +170,24 @@ module ConstantValue { /** A constant `nil` value. */ class ConstantNilValue extends ConstantValue, TNil { } + + /** Gets the integer constant `x`. */ + ConstantValue getInt(int x) { result.getInt() = x } + + /** Gets the float constant `x`. */ + ConstantValue getFloat(float x) { result.getFloat() = x } + + /** Gets the string constant `x`. */ + ConstantValue getString(string x) { result.getString() = x } + + /** Gets the symbol constant `x`. */ + ConstantValue getSymbol(string x) { result.getSymbol() = x } + + /** Gets the regexp constant `x`. */ + ConstantValue getRegExp(string x) { result.getRegExp() = x } + + /** Gets the string, symbol, or regexp constant `x`. */ + ConstantValue getStringlikeValue(string x) { result.getStringlikeValue() = x } } /** An access to a constant. */