Ruby 1.8.7 リファレンスマニュアル > ライブラリ一覧 > test/unit/util/observableライブラリ > Test::Unit::Util::Observableモジュール

module Test::Unit::Util::Observable

クラスの継承リスト: Test::Unit::Util::Observable

要約

This is a utility class that allows anything mixing it in to notify a set of listeners about interesting events.

インスタンスメソッド

定義 説明
add_listener(channel_name, listener_key=NOTHING, &listener)

Adds the passed proc as a listener on the channel indicated by channel_name. listener_key is used to remove the listener later; if none is specified, the proc itself is used.

notify_listeners(channel_name, *arguments)

Calls all the procs registered on the channel indicated by channel_name. If value is specified, it is passed in to the procs, otherwise they are called with no arguments.

remove_listener(channel_name, listener_key)

Removes the listener indicated by listener_key from the channel indicated by channel_name. Returns the registered proc, or nil if none was found.