Class: Ronin::Code::SQL::Between
- Defined in:
- lib/ronin/code/sql/between.rb
Instance Attribute Summary collapse
-
#expr ⇒ Object
readonly
Expression.
-
#higher ⇒ Object
readonly
Higher bound.
-
#lower ⇒ Object
readonly
Lower bound.
Instance Method Summary collapse
- #emit ⇒ Object
-
#initialize(expr, lower, higher) ⇒ Between
constructor
A new instance of Between.
- #not! ⇒ Object
Methods inherited from Expr
Constructor Details
#initialize(expr, lower, higher) ⇒ Between
Returns a new instance of Between.
38 39 40 41 42 43 |
# File 'lib/ronin/code/sql/between.rb', line 38 def initialize(expr,lower,higher) @expr = expr @lower = lower @higher = higher @negated = false end |
Instance Attribute Details
#expr ⇒ Object (readonly)
Expression
30 31 32 |
# File 'lib/ronin/code/sql/between.rb', line 30 def expr @expr end |
#higher ⇒ Object (readonly)
Higher bound
36 37 38 |
# File 'lib/ronin/code/sql/between.rb', line 36 def higher @higher end |
#lower ⇒ Object (readonly)
Lower bound
33 34 35 |
# File 'lib/ronin/code/sql/between.rb', line 33 def lower @lower end |
Instance Method Details
#emit ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/ronin/code/sql/between.rb', line 50 def emit tokens = emit_value(@expr) tokens += emit_token('NOT') if @negated tokens += emit_token('BETWEEN') tokens += emit_value(@lower) tokens += emit_token('AND') tokens += emit_value(@higher) return tokens end |
#not! ⇒ Object
45 46 47 48 |
# File 'lib/ronin/code/sql/between.rb', line 45 def not! @negated = true return self end |