Module: Ronin::SQL::Literals

Included in:
Clause, Injection, InjectionExpr, Statement
Defined in:
lib/ronin/sql/literals.rb

Overview

Methods for creating SQL Literal.

Instance Method Summary collapse

Instance Method Details

#float(value) ⇒ Literal<Float>

Creates an Float literal.

Returns:

  • (Literal<Float>)

    The Float literal.



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

def float(value)
  Literal.new(value.to_f)
end

#int(value) ⇒ Literal<Integer>

Creates an Integer literal.

Returns:

  • (Literal<Integer>)

    The Integer literal.



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

def int(value)
  Literal.new(value.to_i)
end

#nullLiteral

Creates a NULL literal.

Returns:



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

def null
  Literal.new(:NULL)
end

#string(value) ⇒ Literal<String>

Creates an String literal.

Returns:



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

def string(value)
  Literal.new(value.to_s)
end