moving_window 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/lib/moving_window.rb +6 -3
  2. 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 => @not)
41
+ @instance.filter(@arel, :column => @column, :negate => @negate)
40
42
  end
41
43
 
42
44
  def not
43
- @not = !@not
44
- self
45
+ clone = self.clone
46
+ clone.negate = !@negate
47
+ clone
45
48
  end
46
49
  end
47
50
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: moving_window
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: