Class: MotionWiretap::WiretapMapper
- Defined in:
- lib/motion-wiretap/all/wiretap.rb
Instance Method Summary collapse
-
#initialize(parent, mapper) ⇒ WiretapMapper
constructor
A new instance of WiretapMapper.
- #teardown ⇒ Object
-
#trigger_changed(*values) ⇒ Object
passes the values through the mapper before passing up to the parent implementation.
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, mapper) ⇒ WiretapMapper
Returns a new instance of WiretapMapper.
391 392 393 394 395 396 397 398 |
# File 'lib/motion-wiretap/all/wiretap.rb', line 391 def initialize(parent, mapper) @parent = parent @mapper = mapper @parent.listen(self) super() end |
Instance Method Details
#teardown ⇒ Object
406 407 408 409 |
# File 'lib/motion-wiretap/all/wiretap.rb', line 406 def teardown @parent = nil super end |
#trigger_changed(*values) ⇒ Object
passes the values through the mapper before passing up to the parent implementation
402 403 404 |
# File 'lib/motion-wiretap/all/wiretap.rb', line 402 def trigger_changed(*values) super(*values.map { |value| @mapper.call(value) }) end |