Class: AudioStream::AudioObserverLambda

Inherits:
Object
  • Object
show all
Includes:
AudioObserver
Defined in:
lib/audio_stream/audio_observer_lambda.rb

Instance Method Summary collapse

Methods included from AudioObserver

#update

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_completeObject



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