Class: MotionWiretap::WiretapMapper
- Inherits:
-
WiretapChild
- Object
- Wiretap
- WiretapChild
- MotionWiretap::WiretapMapper
- Defined in:
- lib/motion-wiretap/all/wiretap.rb
Instance Attribute Summary
Attributes inherited from Wiretap
Instance Method Summary collapse
-
#initialize(parent, mapper) ⇒ WiretapMapper
constructor
A new instance of WiretapMapper.
-
#trigger_changed(*values) ⇒ Object
passes the values through the mapper before passing up to the parent implementation.
Methods inherited from WiretapChild
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.
400 401 402 403 |
# File 'lib/motion-wiretap/all/wiretap.rb', line 400 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
407 408 409 |
# File 'lib/motion-wiretap/all/wiretap.rb', line 407 def trigger_changed(*values) super(*values.map { |value| @mapper.call(value) }) end |