Module: WhereableClause::Conjunction

Defined in:
lib/whereable_clause.rb

Instance Method Summary collapse

Instance Method Details

#to_hObject

Hash for AND



23
24
25
26
27
28
29
# File 'lib/whereable_clause.rb', line 23

def to_h
  return term.to_h if opt.empty?

  {
    and: [term.to_h] + opt.elements.map { |o| o.term.to_h },
  }
end