Class: MovingWindow::Proc

Inherits:
Proc
  • Object
show all
Defined in:
lib/moving_window.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Proc

Returns a new instance of Proc.



42
43
44
# File 'lib/moving_window.rb', line 42

def initialize(*args)
  @instance, @arel, @column = args
end

Instance Attribute Details

#negate=(value) ⇒ Object (writeonly)

Sets the attribute negate

Parameters:

  • value

    the value to set the attribute negate to.



40
41
42
# File 'lib/moving_window.rb', line 40

def negate=(value)
  @negate = value
end

Instance Method Details

#callObject



46
47
48
# File 'lib/moving_window.rb', line 46

def call
  @instance.filter(@arel, :column => @column, :negate => @negate)
end

#notObject



50
51
52
53
54
# File 'lib/moving_window.rb', line 50

def not
  clone = self.clone
  clone.negate = !@negate
  clone
end