Class: MotionWiretap::WiretapMapper

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, mapper) ⇒ WiretapMapper

Returns a new instance of WiretapMapper.



384
385
386
387
388
# File 'lib/motion-wiretap/all/wiretap.rb', line 384

def initialize(parent, mapper)
  @mapper = mapper

  super(parent)
end

Instance Method Details

#trigger_changed(*values) ⇒ Object

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



392
393
394
# File 'lib/motion-wiretap/all/wiretap.rb', line 392

def trigger_changed(*values)
  super(*values.map { |value| @mapper.call(value) })
end