module Card::Query::CardQuery::Conjunctions
conjoining conditions
Public Instance Methods
all(val)
click to toggle source
# File lib/card/query/card_query/conjunctions.rb, line 6 def all val conjoin val, :and end
Also aliased as: and
any(val)
click to toggle source
# File lib/card/query/card_query/conjunctions.rb, line 11 def any val conjoin val, :or end
current_conjunction()
click to toggle source
# File lib/card/query/card_query/conjunctions.rb, line 21 def current_conjunction @mods[:conj].blank? ? :and : @mods[:conj] end
not(val)
click to toggle source
# File lib/card/query/card_query/conjunctions.rb, line 17 def not val tie :card, val, { id: :id }, { negate: true } end
Private Instance Methods
conjoin(val, conj)
click to toggle source
# File lib/card/query/card_query/conjunctions.rb, line 33 def conjoin val, conj subquery = subquery fasten: :direct, conj: conj conjoinable_val(val).each do |val_item| subquery.interpret val_item end end
conjoinable_val(val)
click to toggle source
# File lib/card/query/card_query/conjunctions.rb, line 40 def conjoinable_val val return val if val.is_a? Array clause_to_hash(val).map { |key, value| { key => value } } end
conjunction(val)
click to toggle source
# File lib/card/query/card_query/conjunctions.rb, line 27 def conjunction val return unless [String, Symbol].member? val.class CONJUNCTIONS[val.to_sym] end