diff options
author | Emilio Tagua <miloops@gmail.com> | 2010-05-27 10:07:51 -0300 |
---|---|---|
committer | Emilio Tagua <miloops@gmail.com> | 2010-05-27 10:07:51 -0300 |
commit | a158a736c821703682fc89bb83d7990e4618b08c (patch) | |
tree | 832aa0281b0eaa932eda77f6e6da0be194db97ae /lib/arel/engines/memory | |
parent | 43bfd3fae496a2a859aad0a654a91437357c3450 (diff) | |
parent | 2ee391231842eec5ce75517c0b24576c1e2a3261 (diff) | |
download | rails-a158a736c821703682fc89bb83d7990e4618b08c.tar.gz rails-a158a736c821703682fc89bb83d7990e4618b08c.tar.bz2 rails-a158a736c821703682fc89bb83d7990e4618b08c.zip |
Merge branch 'master' of github.com:brynary/arel
Diffstat (limited to 'lib/arel/engines/memory')
-rw-r--r-- | lib/arel/engines/memory/predicates.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/arel/engines/memory/predicates.rb b/lib/arel/engines/memory/predicates.rb index 8b3e5843cc..cca6739424 100644 --- a/lib/arel/engines/memory/predicates.rb +++ b/lib/arel/engines/memory/predicates.rb @@ -5,19 +5,19 @@ module Arel operand1.eval(row).send(operator, operand2.eval(row)) end end - + class Unary < Predicate def eval(row) operand.eval(row).send(operator) end end - + class Not < Unary def eval(row) !operand.eval(row) end end - + class Polyadic < Predicate def eval(row) predicates.send(compounder) do |operation| @@ -25,15 +25,15 @@ module Arel end end end - + class Any < Polyadic def compounder; :any? end end - + class All < Polyadic def compounder; :all? end end - + class CompoundPredicate < Binary def eval(row) eval "operand1.eval(row) #{operator} operand2.eval(row)" @@ -77,7 +77,7 @@ module Arel class Match < Binary def operator; :=~ end end - + class NotMatch < Binary def eval(row) operand1.eval(row) !~ operand2.eval(row) @@ -89,7 +89,7 @@ module Arel operand2.eval(row).include?(operand1.eval(row)) end end - + class NotIn < Binary def eval(row) !(operand2.eval(row).include?(operand1.eval(row))) |