moving_window 2.0.0 → 2.0.1

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 (3) hide show
  1. data/README.md +1 -1
  2. data/lib/moving_window.rb +7 -3
  3. metadata +1 -1
data/README.md CHANGED
@@ -56,7 +56,7 @@ scope :not_recent, MovingWindow.scope { 6.months.ago }.not
56
56
  If you're calling things manually:
57
57
 
58
58
  ```ruby
59
- window.filter(Review, :column => :published_at, :negate => true)
59
+ window.filter(Review, :negate => true)
60
60
  ```
61
61
 
62
62
  ## Contribution
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
- Procxy.new(instance, arel, column)
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 Procxy < Struct.new(:instance, :arel, :column)
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
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.0
4
+ version: 2.0.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: