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.



37
38
39
# File 'lib/moving_window.rb', line 37

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.



35
36
37
# File 'lib/moving_window.rb', line 35

def negate=(value)
  @negate = value
end

Instance Method Details

#callObject



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

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

#notObject



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

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