Module: Ronin::Code::SQL::Operators
- Included in:
- BinaryExpr, Field, Function, Literal, Statement
- Defined in:
- lib/ronin/code/sql/operators.rb
Overview
Methods for creating SQL expressions.
Instance Method Summary collapse
-
#! ⇒ UnaryExpr
Logical negate.
-
#!=(other) ⇒ BinaryExpr
Not equal to.
-
#%(other) ⇒ BinaryExpr
Modulus.
-
#&(other) ⇒ BinaryExpr
Bit-wise
AND
. -
#*(other) ⇒ BinaryExpr
Multiplication.
-
#+(other) ⇒ BinaryExpr
Addition.
-
#+@ ⇒ UnaryExpr
Unary plus.
-
#-(other) ⇒ BinaryExpr
Subtraction.
-
#-@ ⇒ UnaryExpr
Unary minus.
-
#/(other) ⇒ BinaryExpr
Division.
-
#<(other) ⇒ BinaryExpr
Less than.
-
#<<(other) ⇒ BinaryExpr
Bit-wise left shift.
-
#<=(other) ⇒ BinaryExpr
Less than or equal to.
-
#==(other) ⇒ BinaryExpr
Equal to.
-
#>(other) ⇒ BinaryExpr
Greater than.
-
#>=(other) ⇒ BinaryExpr
Greater than or equal to.
-
#>>(other) ⇒ BinaryExpr
Bit-wise right shift.
-
#and(other) ⇒ BinaryExpr
AND
. -
#as(name) ⇒ BinaryExpr
Alias.
-
#glob(other) ⇒ BinaryExpr
GLOB
comparison. -
#in(other) ⇒ BinaryExpr
REGEXP
comparison. -
#is(other) ⇒ BinaryExpr
IS
comparison. -
#is_not(other) ⇒ BinaryExpr
IS NOT
comparison. -
#like(other) ⇒ BinaryExpr
LIKE
comparison. -
#match(other) ⇒ BinaryExpr
MATCH
comparison. -
#not ⇒ UnaryExpr
Logical
NOT
. -
#or(other) ⇒ BinaryExpr
OR
. -
#regexp(other) ⇒ BinaryExpr
REGEXP
comparison. -
#|(other) ⇒ BinaryExpr
Bit-wise
OR
. -
#~ ⇒ UnaryExpr
Bit-wise negate.
Instance Method Details
#! ⇒ UnaryExpr
Logical negate.
344 345 346 |
# File 'lib/ronin/code/sql/operators.rb', line 344 def ! UnaryExpr.new(:!,self) end |
#!=(other) ⇒ BinaryExpr
Not equal to.
208 209 210 |
# File 'lib/ronin/code/sql/operators.rb', line 208 def !=(other) BinaryExpr.new(self,:!=,other) end |
#%(other) ⇒ BinaryExpr
Modulus.
64 65 66 |
# File 'lib/ronin/code/sql/operators.rb', line 64 def %(other) BinaryExpr.new(self,:%,other) end |
#&(other) ⇒ BinaryExpr
Bit-wise AND
.
124 125 126 |
# File 'lib/ronin/code/sql/operators.rb', line 124 def &(other) BinaryExpr.new(self,:&,other) end |
#*(other) ⇒ BinaryExpr
Multiplication.
40 41 42 |
# File 'lib/ronin/code/sql/operators.rb', line 40 def *(other) BinaryExpr.new(self,:*,other) end |
#+(other) ⇒ BinaryExpr
Addition.
76 77 78 |
# File 'lib/ronin/code/sql/operators.rb', line 76 def +(other) BinaryExpr.new(self,:+,other) end |
#+@ ⇒ UnaryExpr
Unary plus.
324 325 326 |
# File 'lib/ronin/code/sql/operators.rb', line 324 def +@ UnaryExpr.new(:+,self) end |
#-(other) ⇒ BinaryExpr
Subtraction.
88 89 90 |
# File 'lib/ronin/code/sql/operators.rb', line 88 def -(other) BinaryExpr.new(self,:-,other) end |
#-@ ⇒ UnaryExpr
Unary minus.
314 315 316 |
# File 'lib/ronin/code/sql/operators.rb', line 314 def -@ UnaryExpr.new(:-,self) end |
#/(other) ⇒ BinaryExpr
Division.
52 53 54 |
# File 'lib/ronin/code/sql/operators.rb', line 52 def /(other) BinaryExpr.new(self,:/,other) end |
#<(other) ⇒ BinaryExpr
Less than.
148 149 150 |
# File 'lib/ronin/code/sql/operators.rb', line 148 def <(other) BinaryExpr.new(self,:<,other) end |
#<<(other) ⇒ BinaryExpr
Bit-wise left shift.
100 101 102 |
# File 'lib/ronin/code/sql/operators.rb', line 100 def <<(other) BinaryExpr.new(self,:<<,other) end |
#<=(other) ⇒ BinaryExpr
Less than or equal to.
160 161 162 |
# File 'lib/ronin/code/sql/operators.rb', line 160 def <=(other) BinaryExpr.new(self,:<=,other) end |
#==(other) ⇒ BinaryExpr
Equal to.
196 197 198 |
# File 'lib/ronin/code/sql/operators.rb', line 196 def ==(other) BinaryExpr.new(self,:"=",other) end |
#>(other) ⇒ BinaryExpr
Greater than.
172 173 174 |
# File 'lib/ronin/code/sql/operators.rb', line 172 def >(other) BinaryExpr.new(self,:>,other) end |
#>=(other) ⇒ BinaryExpr
Greater than or equal to.
184 185 186 |
# File 'lib/ronin/code/sql/operators.rb', line 184 def >=(other) BinaryExpr.new(self,:>=,other) end |
#>>(other) ⇒ BinaryExpr
Bit-wise right shift.
112 113 114 |
# File 'lib/ronin/code/sql/operators.rb', line 112 def >>(other) BinaryExpr.new(self,:>>,other) end |
#and(other) ⇒ BinaryExpr
AND
.
366 367 368 |
# File 'lib/ronin/code/sql/operators.rb', line 366 def and(other) BinaryExpr.new(self,:AND,other) end |
#as(name) ⇒ BinaryExpr
Alias.
220 221 222 |
# File 'lib/ronin/code/sql/operators.rb', line 220 def as(name) BinaryExpr.new(self,:AS,name) end |
#glob(other) ⇒ BinaryExpr
GLOB
comparison.
268 269 270 |
# File 'lib/ronin/code/sql/operators.rb', line 268 def glob(other) BinaryExpr.new(self,:GLOB,other) end |
#in(other) ⇒ BinaryExpr
REGEXP
comparison.
304 305 306 |
# File 'lib/ronin/code/sql/operators.rb', line 304 def in(other) BinaryExpr.new(self,:IN,other) end |
#is(other) ⇒ BinaryExpr
IS
comparison.
232 233 234 |
# File 'lib/ronin/code/sql/operators.rb', line 232 def is(other) BinaryExpr.new(self,:IS,other) end |
#is_not(other) ⇒ BinaryExpr
IS NOT
comparison.
244 245 246 |
# File 'lib/ronin/code/sql/operators.rb', line 244 def is_not(other) BinaryExpr.new(self,[:IS, :NOT],other) end |
#like(other) ⇒ BinaryExpr
LIKE
comparison.
256 257 258 |
# File 'lib/ronin/code/sql/operators.rb', line 256 def like(other) BinaryExpr.new(self,:LIKE,other) end |
#match(other) ⇒ BinaryExpr
MATCH
comparison.
280 281 282 |
# File 'lib/ronin/code/sql/operators.rb', line 280 def match(other) BinaryExpr.new(self,:MATCH,other) end |
#not ⇒ UnaryExpr
Logical NOT
.
354 355 356 |
# File 'lib/ronin/code/sql/operators.rb', line 354 def not UnaryExpr.new(:NOT,self) end |
#or(other) ⇒ BinaryExpr
OR
.
378 379 380 |
# File 'lib/ronin/code/sql/operators.rb', line 378 def or(other) BinaryExpr.new(self,:OR,other) end |
#regexp(other) ⇒ BinaryExpr
REGEXP
comparison.
292 293 294 |
# File 'lib/ronin/code/sql/operators.rb', line 292 def regexp(other) BinaryExpr.new(self,:REGEXP,other) end |
#|(other) ⇒ BinaryExpr
Bit-wise OR
.
136 137 138 |
# File 'lib/ronin/code/sql/operators.rb', line 136 def |(other) BinaryExpr.new(self,:|,other) end |