Class: MotionWiretap::WiretapFilter

Inherits:
WiretapChild show all
Defined in:
lib/motion-wiretap/all/wiretap.rb

Instance Method Summary collapse

Methods inherited from WiretapChild

#teardown

Methods inherited from Wiretap

#and_then, #cancel!, #combine, #dealloc, #enqueue, #filter, #listen, #map, #on_error, #queue, #reduce, #teardown, #trigger_changed_on, #trigger_completed, #trigger_completed_on, #trigger_error, #trigger_error_on

Constructor Details

#initialize(parent, filter) ⇒ WiretapFilter

Returns a new instance of WiretapFilter.



338
339
340
341
# File 'lib/motion-wiretap/all/wiretap.rb', line 338

def initialize(parent, filter)
  @filter = filter
  super(parent)
end

Instance Method Details

#trigger_changed(*values) ⇒ Object

passes the values through the filter before passing up to the parent implementation



345
346
347
348
349
# File 'lib/motion-wiretap/all/wiretap.rb', line 345

def trigger_changed(*values)
  if ( @filter.call(*values) )
    super(*values)
  end
end