Class: Mohair::Where
- Inherits:
-
Object
- Object
- Mohair::Where
- Defined in:
- lib/mohair/sql/tree.rb
Instance Method Summary collapse
-
#initialize(tree) ⇒ Where
constructor
A new instance of Where.
- #to_js ⇒ Object
Constructor Details
#initialize(tree) ⇒ Where
Returns a new instance of Where.
167 168 169 170 171 172 173 |
# File 'lib/mohair/sql/tree.rb', line 167 def initialize tree if tree then @cond = Condition.new tree else @cond = nil end end |
Instance Method Details
#to_js ⇒ Object
174 175 176 177 178 179 180 181 |
# File 'lib/mohair/sql/tree.rb', line 174 def to_js if @cond.nil? then "return [ret];" else s = @cond.to_js "if(#{s}){ return [ret]; }else{ return[]; }" end end |