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

Instance Method Details

#!UnaryExpr

Logical negate.

Returns:



344
345
346
# File 'lib/ronin/code/sql/operators.rb', line 344

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

#!=(other) ⇒ BinaryExpr

Not equal to.

Parameters:

  • other (Object)

Returns:



208
209
210
# File 'lib/ronin/code/sql/operators.rb', line 208

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

#%(other) ⇒ BinaryExpr

Modulus.

Parameters:

  • other (Object)

Returns:



64
65
66
# File 'lib/ronin/code/sql/operators.rb', line 64

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

#&(other) ⇒ BinaryExpr

Bit-wise AND.

Parameters:

  • other (Object)

Returns:



124
125
126
# File 'lib/ronin/code/sql/operators.rb', line 124

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

#*(other) ⇒ BinaryExpr

Multiplication.

Parameters:

  • other (Object)

Returns:



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

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

#+(other) ⇒ BinaryExpr

Addition.

Parameters:

  • other (Object)

Returns:



76
77
78
# File 'lib/ronin/code/sql/operators.rb', line 76

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

#+@UnaryExpr

Unary plus.

Returns:



324
325
326
# File 'lib/ronin/code/sql/operators.rb', line 324

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

#-(other) ⇒ BinaryExpr

Subtraction.

Parameters:

  • other (Object)

Returns:



88
89
90
# File 'lib/ronin/code/sql/operators.rb', line 88

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

#-@UnaryExpr

Unary minus.

Returns:



314
315
316
# File 'lib/ronin/code/sql/operators.rb', line 314

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

#/(other) ⇒ BinaryExpr

Division.

Parameters:

  • other (Object)

Returns:



52
53
54
# File 'lib/ronin/code/sql/operators.rb', line 52

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

#<(other) ⇒ BinaryExpr

Less than.

Parameters:

  • other (Object)

Returns:



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.

Parameters:

  • other (Object)

Returns:



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.

Parameters:

  • other (Object)

Returns:



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

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

#==(other) ⇒ BinaryExpr

Equal to.

Parameters:

  • other (Object)

Returns:



196
197
198
# File 'lib/ronin/code/sql/operators.rb', line 196

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

#>(other) ⇒ BinaryExpr

Greater than.

Parameters:

  • other (Object)

Returns:



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.

Parameters:

  • other (Object)

Returns:



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.

Parameters:

  • other (Object)

Returns:



112
113
114
# File 'lib/ronin/code/sql/operators.rb', line 112

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

#and(other) ⇒ BinaryExpr

AND.

Parameters:

  • other (Object)

Returns:



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.

Parameters:

  • name (Symbol)

Returns:



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.

Parameters:

  • other (Object)

Returns:



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.

Parameters:

  • other (Object)

Returns:



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.

Parameters:

  • other (Object)

Returns:



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.

Parameters:

  • other (Object)

Returns:



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.

Parameters:

  • other (Object)

Returns:



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.

Parameters:

  • other (Object)

Returns:



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

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

#notUnaryExpr

Logical NOT.

Returns:



354
355
356
# File 'lib/ronin/code/sql/operators.rb', line 354

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

#or(other) ⇒ BinaryExpr

OR.

Parameters:

  • other (Object)

Returns:



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.

Parameters:

  • other (Object)

Returns:



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.

Parameters:

  • other (Object)

Returns:



136
137
138
# File 'lib/ronin/code/sql/operators.rb', line 136

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

#~UnaryExpr

Bit-wise negate.

Returns:



334
335
336
# File 'lib/ronin/code/sql/operators.rb', line 334

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