module Concurrent::Concern::Observable
def add_observer(observer = nil, func = :update, &block)
-
(Object)
- the added observer
Parameters:
-
func
(Symbol
) -- the function to call on the observer during notification. -
observer
(Object
) -- the observer to add
def add_observer(observer = nil, func = :update, &block) observers.add_observer(observer, func, &block) end
def count_observers
-
(Integer)
- the observers count
def count_observers observers.count_observers end
def delete_observer(observer)
-
(Object)
- the deleted observer
Parameters:
-
observer
(Object
) -- the observer to remove
def delete_observer(observer) observers.delete_observer(observer) end
def delete_observers
-
(Observable)
- self
def delete_observers observers.delete_observers self end
def with_observer(observer = nil, func = :update, &block)
-
(Observable)
- self
Parameters:
-
func
(Symbol
) -- the function to call on the observer during notification. -
observer
(Object
) -- the observer to add
def with_observer(observer = nil, func = :update, &block) add_observer(observer, func, &block) self end