Class: LimitedObserver
- Inherits:
-
SimpleObserver
- Object
- SimpleObserver
- LimitedObserver
- Defined in:
- lib/rui/observer_utils.rb
Instance Method Summary collapse
-
#initialize(observed, event, &blk) ⇒ LimitedObserver
constructor
A new instance of LimitedObserver.
- #update(data) ⇒ Object
Constructor Details
#initialize(observed, event, &blk) ⇒ LimitedObserver
Returns a new instance of LimitedObserver.
168 169 170 171 |
# File 'lib/rui/observer_utils.rb', line 168 def initialize(observed, event, &blk) super(event, &blk) @observed = observed end |
Instance Method Details
#update(data) ⇒ Object
173 174 175 176 177 |
# File 'lib/rui/observer_utils.rb', line 173 def update(data) remove = super(data) @observed.delete_observer(self) if remove remove end |