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

Instance Method Details

#!UnaryExpr

Logical negate.

Returns:



299
300
301
# File 'lib/ronin/sql/operators.rb', line 299

def !
  UnaryExpr.new(:!,self)
end

#!=(other) ⇒ BinaryExpr

Not equal to.

Returns:



179
180
181
# File 'lib/ronin/sql/operators.rb', line 179

def !=(other)
  BinaryExpr.new(self,:!=,other)
end

#%(other) ⇒ BinaryExpr

Modulus.

Returns:



59
60
61
# File 'lib/ronin/sql/operators.rb', line 59

def %(other)
  BinaryExpr.new(self,:%,other)
end

#&(other) ⇒ BinaryExpr

Bit-wise AND.

Returns:



109
110
111
# File 'lib/ronin/sql/operators.rb', line 109

def &(other)
  BinaryExpr.new(self,:&,other)
end

#*(other) ⇒ BinaryExpr

Multiplication.

Returns:



39
40
41
# File 'lib/ronin/sql/operators.rb', line 39

def *(other)
  BinaryExpr.new(self,:*,other)
end

#+(other) ⇒ BinaryExpr

Addition.

Returns:



69
70
71
# File 'lib/ronin/sql/operators.rb', line 69

def +(other)
  BinaryExpr.new(self,:+,other)
end

#+@UnaryExpr

Unary plus.

Returns:



279
280
281
# File 'lib/ronin/sql/operators.rb', line 279

def +@
  UnaryExpr.new(:+,self)
end

#-(other) ⇒ BinaryExpr

Subtraction.

Returns:



79
80
81
# File 'lib/ronin/sql/operators.rb', line 79

def -(other)
  BinaryExpr.new(self,:-,other)
end

#-@UnaryExpr

Unary minus.

Returns:



269
270
271
# File 'lib/ronin/sql/operators.rb', line 269

def -@
  UnaryExpr.new(:-,self)
end

#/(other) ⇒ BinaryExpr

Division.

Returns:



49
50
51
# File 'lib/ronin/sql/operators.rb', line 49

def /(other)
  BinaryExpr.new(self,:/,other)
end

#<(other) ⇒ BinaryExpr

Less than.

Returns:



129
130
131
# File 'lib/ronin/sql/operators.rb', line 129

def <(other)
  BinaryExpr.new(self,:<,other)
end

#<<(other) ⇒ BinaryExpr

Bit-wise left shift.

Returns:



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.

Returns:



139
140
141
# File 'lib/ronin/sql/operators.rb', line 139

def <=(other)
  BinaryExpr.new(self,:<=,other)
end

#==(other) ⇒ BinaryExpr

Equal to.

Returns:



169
170
171
# File 'lib/ronin/sql/operators.rb', line 169

def ==(other)
  BinaryExpr.new(self,:"=",other)
end

#>(other) ⇒ BinaryExpr

Greater than.

Returns:



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.

Returns:



159
160
161
# File 'lib/ronin/sql/operators.rb', line 159

def >=(other)
  BinaryExpr.new(self,:>=,other)
end

#>>(other) ⇒ BinaryExpr

Bit-wise right shift.

Returns:



99
100
101
# File 'lib/ronin/sql/operators.rb', line 99

def >>(other)
  BinaryExpr.new(self,:>>,other)
end

#and(other) ⇒ BinaryExpr

AND.

Returns:



319
320
321
# File 'lib/ronin/sql/operators.rb', line 319

def and(other)
  BinaryExpr.new(self,:AND,other)
end

#as(name) ⇒ BinaryExpr

Alias.

Returns:



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.

Returns:



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.

Returns:



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.

Returns:



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.

Returns:



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.

Returns:



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.

Returns:



239
240
241
# File 'lib/ronin/sql/operators.rb', line 239

def match(other)
  BinaryExpr.new(self,:MATCH,other)
end

#notUnaryExpr

Logical NOT.

Returns:



309
310
311
# File 'lib/ronin/sql/operators.rb', line 309

def not
  UnaryExpr.new(:NOT,self)
end

#or(other) ⇒ BinaryExpr

OR.

Returns:



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.

Returns:



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.

Returns:



119
120
121
# File 'lib/ronin/sql/operators.rb', line 119

def |(other)
  BinaryExpr.new(self,:|,other)
end

#~UnaryExpr

Bit-wise negate.

Returns:



289
290
291
# File 'lib/ronin/sql/operators.rb', line 289

def ~
  UnaryExpr.new(:~,self)
end