Class: AudioStream::AudioObserverLambda
- Inherits:
-
Object
- Object
- AudioStream::AudioObserverLambda
- Includes:
- AudioObserver
- Defined in:
- lib/audio_stream/audio_observer_lambda.rb
Instance Method Summary collapse
-
#initialize(on_next:, on_complete:) ⇒ AudioObserverLambda
constructor
A new instance of AudioObserverLambda.
- #on_complete ⇒ Object
- #on_next(input) ⇒ Object
Methods included from AudioObserver
Constructor Details
#initialize(on_next:, on_complete:) ⇒ AudioObserverLambda
Returns a new instance of AudioObserverLambda.
6 7 8 9 |
# File 'lib/audio_stream/audio_observer_lambda.rb', line 6 def initialize(on_next:, on_complete:) @on_next = on_next || ->(input){} @on_complete = on_complete || ->(){} end |
Instance Method Details
#on_complete ⇒ Object
15 16 17 |
# File 'lib/audio_stream/audio_observer_lambda.rb', line 15 def on_complete @on_complete[] end |
#on_next(input) ⇒ Object
11 12 13 |
# File 'lib/audio_stream/audio_observer_lambda.rb', line 11 def on_next(input) @on_next[input] end |