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

Class ConstantValue

A constant value.

Import path

import codeql.ruby.AST

Direct supertypes

Known direct subtypes

Predicates

getBoolean

Gets the Boolean value, if this is a Boolean.

getFloat

Gets the float value, if this is a float.

getInt

Gets the integer value, if this is an integer.

getRegExp

Gets the regexp value, if this is a regexp.

getString

Gets the string value, if this is a string.

getStringlikeValue

Gets the string/symbol/regexp value, if any.

getSymbol

Gets the symbol value (excluding the : prefix), if this is a symbol.

getValueType

Gets a string describing the type of this constant value.

isBoolean

Holds if this is the Boolean value b.

isComplex

Holds if this is the complex value real + imaginary * i.

isFloat

Holds if this is the float value f.

isInt

Holds if this is the integer value i.

isNil

Holds if this is the nil value.

isRational

Holds if this is the rational value numerator / denominator.

isRegExp

Holds if this is the regexp value /s/, ignoring any flags.

isRegExpWithFlags

Holds if this is the regexp value /s/flags .

isString

Holds if this is the string value s.

isStringlikeValue

Holds if this is: - the string value s, - the symbol value :s, or - the regexp value /s/.

isSymbol

Holds if this is the symbol value :s.

serialize

Gets a (unique) serialized version of this value.

toString

Gets a textual representation of this constant value.