Class: MovingWindow
- Inherits:
-
Object
- Object
- MovingWindow
- Defined in:
- lib/moving_window.rb
Defined Under Namespace
Classes: Proc
Class Method Summary collapse
Instance Method Summary collapse
- #filter(scope, params = {}) ⇒ Object
-
#initialize(&block) ⇒ MovingWindow
constructor
A new instance of MovingWindow.
Constructor Details
#initialize(&block) ⇒ MovingWindow
Returns a new instance of MovingWindow.
10 11 12 |
# File 'lib/moving_window.rb', line 10 def initialize(&block) @block = block end |
Class Method Details
Instance Method Details
#filter(scope, params = {}) ⇒ Object
14 15 16 17 18 |
# File 'lib/moving_window.rb', line 14 def filter(scope, params = {}) column, qualifier = parse(params) t = scope.table_name scope.where(["#{t}.#{column} #{qualifier} ? and ?", *]) end |