Module: Card::Query::CardQuery::Conjunctions

Included in:
Card::Query::CardQuery
Defined in:
card/lib/card/query/card_query/conjunctions.rb

Overview

conjoining conditions

Instance Method Summary collapse

Instance Method Details

#all(val) ⇒ Object Also known as: and



6
7
8
# File 'card/lib/card/query/card_query/conjunctions.rb', line 6

def all val
  conjoin val, :and
end

#any(val) ⇒ Object Also known as: or, in



11
12
13
# File 'card/lib/card/query/card_query/conjunctions.rb', line 11

def any val
  conjoin val, :or
end

#current_conjunctionObject



21
22
23
# File 'card/lib/card/query/card_query/conjunctions.rb', line 21

def current_conjunction
  @mods[:conj].blank? ? :and : @mods[:conj]
end

#not(val) ⇒ Object



17
18
19
# File 'card/lib/card/query/card_query/conjunctions.rb', line 17

def not val
  tie :card, val, { id: :id }, negate: true
end