moving_window 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/moving_window.rb +7 -3
- metadata +1 -1
data/README.md
CHANGED
data/lib/moving_window.rb
CHANGED
@@ -4,7 +4,7 @@ class MovingWindow
|
|
4
4
|
arel = block.binding.eval("self")
|
5
5
|
instance = new(&block)
|
6
6
|
|
7
|
-
|
7
|
+
Proc.new(instance, arel, column)
|
8
8
|
end
|
9
9
|
|
10
10
|
def initialize(&block)
|
@@ -30,9 +30,13 @@ class MovingWindow
|
|
30
30
|
[from, to].sort
|
31
31
|
end
|
32
32
|
|
33
|
-
class
|
33
|
+
class Proc < ::Proc
|
34
|
+
def initialize(*args)
|
35
|
+
@instance, @arel, @column = args
|
36
|
+
end
|
37
|
+
|
34
38
|
def call
|
35
|
-
instance.filter(arel, :column => column, :negate => @not)
|
39
|
+
@instance.filter(@arel, :column => @column, :negate => @not)
|
36
40
|
end
|
37
41
|
|
38
42
|
def not
|