module Concurrent::Concern::Observable

def add_observer(observer = nil, func = :update, &block)

Returns:
  • (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

Returns:
  • (Integer) - the observers count
def count_observers
  observers.count_observers
end

def delete_observer(observer)

Returns:
  • (Object) - the deleted observer

Parameters:
  • observer (Object) -- the observer to remove
def delete_observer(observer)
  observers.delete_observer(observer)
end

def delete_observers

Returns:
  • (Observable) - self
def delete_observers
  observers.delete_observers
  self
end

def with_observer(observer = nil, func = :update, &block)

Returns:
  • (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