Sha256: ec011b71b159557b0f4dc2e5b802d89972f39e2837e3504e52bc6eb97ed88d99
Contents?: true
Size: 1.02 KB
Versions: 23
Compression:
Stored size: 1.02 KB
Contents
class Card module Query class CardQuery # conjoining conditions module Conjunctions def all val conjoin val, :and end alias_method :and, :all def any val conjoin val, :or end alias_method :or, :any alias_method :in, :any def not val tie :card, val, { id: :id }, { negate: true } end def current_conjunction @mods[:conj].blank? ? :and : @mods[:conj] end private def conjunction val return unless [String, Symbol].member? val.class CONJUNCTIONS[val.to_sym] end def conjoin val, conj subquery = subquery fasten: :direct, conj: conj conjoinable_val(val).each do |val_item| subquery.interpret val_item end end def conjoinable_val val return val if val.is_a? Array clause_to_hash(val).map { |key, value| { key => value } } end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems