Class: Reactive::Observable::Push::Observer
- Inherits:
-
Reactive::ObserverWrapper
- Object
- Reactive::ObserverWrapper
- Reactive::Observable::Push::Observer
- Defined in:
- lib/Reactive/observable/push.rb
Instance Attribute Summary collapse
-
#next_observable ⇒ Object
readonly
Returns the value of attribute next_observable.
Attributes inherited from Reactive::ObserverWrapper
Instance Method Summary collapse
-
#initialize(observer, parent, ob) ⇒ Observer
constructor
A new instance of Observer.
- #on_complete ⇒ Object
- #unwrap ⇒ Object
Methods inherited from Reactive::ObserverWrapper
#active?, #attributes, #on_next, #unwrap_parent, #wrap_with_parent
Constructor Details
#initialize(observer, parent, ob) ⇒ Observer
Returns a new instance of Observer.
21 22 23 24 |
# File 'lib/Reactive/observable/push.rb', line 21 def initialize(observer, parent, ob) @next_observable = ob super(observer, parent) end |
Instance Attribute Details
#next_observable ⇒ Object (readonly)
Returns the value of attribute next_observable.
19 20 21 |
# File 'lib/Reactive/observable/push.rb', line 19 def next_observable @next_observable end |
Instance Method Details
#on_complete ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/Reactive/observable/push.rb', line 26 def on_complete if @next_observable next_observable = @next_observable @next_observable = nil disposable = next_observable.subscribe_observer(self) wrap_with_parent(disposable) if @target else @target.on_complete unwrap end end |
#unwrap ⇒ Object
38 39 40 41 |
# File 'lib/Reactive/observable/push.rb', line 38 def unwrap @next_observable = nil super end |