moving_window 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/moving_window.rb +6 -3
- metadata +1 -1
data/lib/moving_window.rb
CHANGED
@@ -31,17 +31,20 @@ class MovingWindow
|
|
31
31
|
end
|
32
32
|
|
33
33
|
class Proc < ::Proc
|
34
|
+
attr_writer :negate
|
35
|
+
|
34
36
|
def initialize(*args)
|
35
37
|
@instance, @arel, @column = args
|
36
38
|
end
|
37
39
|
|
38
40
|
def call
|
39
|
-
@instance.filter(@arel, :column => @column, :negate => @
|
41
|
+
@instance.filter(@arel, :column => @column, :negate => @negate)
|
40
42
|
end
|
41
43
|
|
42
44
|
def not
|
43
|
-
|
44
|
-
|
45
|
+
clone = self.clone
|
46
|
+
clone.negate = !@negate
|
47
|
+
clone
|
45
48
|
end
|
46
49
|
end
|
47
50
|
|