Module: Ronin::SQL::Operators
- Included in:
- BinaryExpr, Field, Function, Literal, Statement
- Defined in:
- lib/ronin/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.
299 300 301 |
# File 'lib/ronin/sql/operators.rb', line 299 def ! UnaryExpr.new(:!,self) end |
#!=(other) ⇒ BinaryExpr
Not equal to.
179 180 181 |
# File 'lib/ronin/sql/operators.rb', line 179 def !=(other) BinaryExpr.new(self,:!=,other) end |
#%(other) ⇒ BinaryExpr
Modulus.
59 60 61 |
# File 'lib/ronin/sql/operators.rb', line 59 def %(other) BinaryExpr.new(self,:%,other) end |
#&(other) ⇒ BinaryExpr
Bit-wise AND
.
109 110 111 |
# File 'lib/ronin/sql/operators.rb', line 109 def &(other) BinaryExpr.new(self,:&,other) end |
#*(other) ⇒ BinaryExpr
Multiplication.
39 40 41 |
# File 'lib/ronin/sql/operators.rb', line 39 def *(other) BinaryExpr.new(self,:*,other) end |
#+(other) ⇒ BinaryExpr
Addition.
69 70 71 |
# File 'lib/ronin/sql/operators.rb', line 69 def +(other) BinaryExpr.new(self,:+,other) end |
#+@ ⇒ UnaryExpr
Unary plus.
279 280 281 |
# File 'lib/ronin/sql/operators.rb', line 279 def +@ UnaryExpr.new(:+,self) end |
#-(other) ⇒ BinaryExpr
Subtraction.
79 80 81 |
# File 'lib/ronin/sql/operators.rb', line 79 def -(other) BinaryExpr.new(self,:-,other) end |
#-@ ⇒ UnaryExpr
Unary minus.
269 270 271 |
# File 'lib/ronin/sql/operators.rb', line 269 def -@ UnaryExpr.new(:-,self) end |
#/(other) ⇒ BinaryExpr
Division.
49 50 51 |
# File 'lib/ronin/sql/operators.rb', line 49 def /(other) BinaryExpr.new(self,:/,other) end |
#<(other) ⇒ BinaryExpr
Less than.
129 130 131 |
# File 'lib/ronin/sql/operators.rb', line 129 def <(other) BinaryExpr.new(self,:<,other) end |
#<<(other) ⇒ BinaryExpr
Bit-wise left shift.
89 90 91 |
# File 'lib/ronin/sql/operators.rb', line 89 def <<(other) BinaryExpr.new(self,:<<,other) end |
#<=(other) ⇒ BinaryExpr
Less than or equal to.
139 140 141 |
# File 'lib/ronin/sql/operators.rb', line 139 def <=(other) BinaryExpr.new(self,:<=,other) end |
#==(other) ⇒ BinaryExpr
Equal to.
169 170 171 |
# File 'lib/ronin/sql/operators.rb', line 169 def ==(other) BinaryExpr.new(self,:"=",other) end |
#>(other) ⇒ BinaryExpr
Greater than.
149 150 151 |
# File 'lib/ronin/sql/operators.rb', line 149 def >(other) BinaryExpr.new(self,:>,other) end |
#>=(other) ⇒ BinaryExpr
Greater than or equal to.
159 160 161 |
# File 'lib/ronin/sql/operators.rb', line 159 def >=(other) BinaryExpr.new(self,:>=,other) end |
#>>(other) ⇒ BinaryExpr
Bit-wise right shift.
99 100 101 |
# File 'lib/ronin/sql/operators.rb', line 99 def >>(other) BinaryExpr.new(self,:>>,other) end |
#and(other) ⇒ BinaryExpr
AND
.
319 320 321 |
# File 'lib/ronin/sql/operators.rb', line 319 def and(other) BinaryExpr.new(self,:AND,other) end |
#as(name) ⇒ BinaryExpr
Alias.
189 190 191 |
# File 'lib/ronin/sql/operators.rb', line 189 def as(name) BinaryExpr.new(self,:AS,name) end |
#glob(other) ⇒ BinaryExpr
GLOB
comparison.
229 230 231 |
# File 'lib/ronin/sql/operators.rb', line 229 def glob(other) BinaryExpr.new(self,:GLOB,other) end |
#in(other) ⇒ BinaryExpr
REGEXP
comparison.
259 260 261 |
# File 'lib/ronin/sql/operators.rb', line 259 def in(other) BinaryExpr.new(self,:IN,other) end |
#is(other) ⇒ BinaryExpr
IS
comparison.
199 200 201 |
# File 'lib/ronin/sql/operators.rb', line 199 def is(other) BinaryExpr.new(self,:IS,other) end |
#is_not(other) ⇒ BinaryExpr
IS NOT
comparison.
209 210 211 |
# File 'lib/ronin/sql/operators.rb', line 209 def is_not(other) BinaryExpr.new(self,[:IS, :NOT],other) end |
#like(other) ⇒ BinaryExpr
LIKE
comparison.
219 220 221 |
# File 'lib/ronin/sql/operators.rb', line 219 def like(other) BinaryExpr.new(self,:LIKE,other) end |
#match(other) ⇒ BinaryExpr
MATCH
comparison.
239 240 241 |
# File 'lib/ronin/sql/operators.rb', line 239 def match(other) BinaryExpr.new(self,:MATCH,other) end |
#not ⇒ UnaryExpr
Logical NOT
.
309 310 311 |
# File 'lib/ronin/sql/operators.rb', line 309 def not UnaryExpr.new(:NOT,self) end |
#or(other) ⇒ BinaryExpr
OR
.
329 330 331 |
# File 'lib/ronin/sql/operators.rb', line 329 def or(other) BinaryExpr.new(self,:OR,other) end |
#regexp(other) ⇒ BinaryExpr
REGEXP
comparison.
249 250 251 |
# File 'lib/ronin/sql/operators.rb', line 249 def regexp(other) BinaryExpr.new(self,:REGEXP,other) end |
#|(other) ⇒ BinaryExpr
Bit-wise OR
.
119 120 121 |
# File 'lib/ronin/sql/operators.rb', line 119 def |(other) BinaryExpr.new(self,:|,other) end |