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.



388
389
390
391
392
# File 'lib/motion-wiretap/all/wiretap.rb', line 388

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



396
397
398
# File 'lib/motion-wiretap/all/wiretap.rb', line 396

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