@@ -18,7 +18,7 @@ library by beginning your query with:
1818
1919.. code-block :: ql
2020
21- import ruby
21+ import codeql. ruby.AST
2222
2323 The CodeQL libraries model various aspects of Ruby code, depending on the type of query you want to write.
2424For example the abstract syntax tree (AST) library is used for locating program elements, to match syntactic
@@ -138,7 +138,7 @@ The following example lists all methods in the class `ApiController`:
138138
139139.. code-block :: ql
140140
141- import ruby
141+ import codeql. ruby.AST
142142
143143 from ClassDeclaration m
144144 where m.getName() = "ApiController"
@@ -223,7 +223,7 @@ Example
223223
224224.. code-block :: ql
225225
226- import ruby
226+ import codeql. ruby.AST
227227
228228 from Method m
229229 where m.getName() = "show"
@@ -274,7 +274,7 @@ The following example finds all literals that are returned by a `return` stateme
274274
275275.. code-block :: ql
276276
277- import ruby
277+ import codeql. ruby.AST
278278
279279 from ReturnStmt return, Literal lit
280280 where lit.getParent() = return
@@ -421,7 +421,7 @@ The following example finds "chained assignments" (of the form ``A=B=C``):
421421
422422.. code-block :: ql
423423
424- import ruby
424+ import codeql. ruby.AST
425425
426426 from Assignment op
427427 where op.getRightOperand() instanceof Assignment
@@ -460,7 +460,7 @@ The following example finds all method calls to a method called `delete`.
460460
461461.. code-block :: ql
462462
463- import ruby
463+ import codeql. ruby.AST
464464
465465 from MethodCall call
466466 where call.getMethodName() = "delete"
@@ -517,7 +517,7 @@ The following example finds `if`-expressions that are missing a `then` branch.
517517
518518.. code-block :: ql
519519
520- import ruby
520+ import codeql. ruby.AST
521521
522522 from IfExpr expr
523523 where not exists(expr.getThen())
@@ -559,7 +559,7 @@ The following example finds all class variables in the class `StaticController`:
559559
560560.. code-block :: ql
561561
562- import ruby
562+ import codeql. ruby.AST
563563
564564 from ClassDeclaration cd, ClassVariable v
565565 where
@@ -612,7 +612,7 @@ The following example finds writes to class variables in the class `StaticContro
612612
613613.. code-block :: ql
614614
615- import ruby
615+ import codeql. ruby.AST
616616
617617 from ClassVariableWriteAccess write, ClassDeclaration cd, ClassVariable v
618618 where
0 commit comments