Class: MotionWiretap::WiretapFilter

Inherits:
Wiretap
  • Object
show all
Defined in:
lib/motion-wiretap/all/wiretap.rb

Instance Method Summary collapse

Methods inherited from Wiretap

#and_then, #cancel!, #combine, #enqueue, #filter, #listen, #map, #on_error, #queue, #reduce, #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.



316
317
318
319
320
321
322
323
# File 'lib/motion-wiretap/all/wiretap.rb', line 316

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

  @parent.listen(self)

  super()
end

Instance Method Details

#teardownObject



333
334
335
336
# File 'lib/motion-wiretap/all/wiretap.rb', line 333

def teardown
  @parent = nil
  super
end

#trigger_changed(*values) ⇒ Object

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



327
328
329
330
331
# File 'lib/motion-wiretap/all/wiretap.rb', line 327

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