Method: Rebel::SQL.and_clause

Defined in:
lib/rebel/sql.rb

.and_clause(*clause) ⇒ Object



356
357
358
359
360
361
362
363
364
365
366
# File 'lib/rebel/sql.rb', line 356

def and_clause(*clause)
  clause.map do |e|
    case e
    when Hash then and_clause(*e.to_a)
    when Array then clause_term(e[0], e[1])
    when Raw then e.parens?
    when String then e
    else raise NotImplementedError, e.class
    end
  end.join(' AND ')
end