Class: AudioStream::AudioObservableLambda
- Inherits:
-
Object
- Object
- AudioStream::AudioObservableLambda
- Includes:
- AudioObservable, AudioObserver
- Defined in:
- lib/audio_stream/audio_observable_lambda.rb
Instance Method Summary collapse
-
#initialize(&block) ⇒ AudioObservableLambda
constructor
A new instance of AudioObservableLambda.
- #on_complete ⇒ Object
- #on_next(input) ⇒ Object
Methods included from AudioObservable
#fx, #mono, #notify_complete, #notify_next, #send_to, #stereo, #subscribe, #subscribe_on_next
Methods included from AudioObserver
Constructor Details
#initialize(&block) ⇒ AudioObservableLambda
Returns a new instance of AudioObservableLambda.
7 8 9 |
# File 'lib/audio_stream/audio_observable_lambda.rb', line 7 def initialize(&block) @block = block end |
Instance Method Details
#on_complete ⇒ Object
16 17 18 |
# File 'lib/audio_stream/audio_observable_lambda.rb', line 16 def on_complete notify_complete end |
#on_next(input) ⇒ Object
11 12 13 14 |
# File 'lib/audio_stream/audio_observable_lambda.rb', line 11 def on_next(input) output = @block.call(input) notify_next(output) end |