Class: Wee::Callbacks
Overview
class CallbackRegistry
Instance Attribute Summary collapse
-
#action_callbacks ⇒ Object
readonly
Returns the value of attribute action_callbacks.
-
#input_callbacks ⇒ Object
readonly
Returns the value of attribute input_callbacks.
Instance Method Summary collapse
-
#initialize ⇒ Callbacks
constructor
A new instance of Callbacks.
- #unregister(object) ⇒ Object
- #with_triggered(ids_and_values) ⇒ Object
Constructor Details
#initialize ⇒ Callbacks
Returns a new instance of Callbacks.
88 89 90 91 |
# File 'lib/wee/callback.rb', line 88 def initialize @input_callbacks = CallbackRegistry.new("") @action_callbacks = CallbackRegistry.new("a") end |
Instance Attribute Details
#action_callbacks ⇒ Object (readonly)
Returns the value of attribute action_callbacks.
86 87 88 |
# File 'lib/wee/callback.rb', line 86 def action_callbacks @action_callbacks end |
#input_callbacks ⇒ Object (readonly)
Returns the value of attribute input_callbacks.
85 86 87 |
# File 'lib/wee/callback.rb', line 85 def input_callbacks @input_callbacks end |
Instance Method Details
#unregister(object) ⇒ Object
93 94 95 96 |
# File 'lib/wee/callback.rb', line 93 def unregister(object) @input_callbacks.unregister(object) @action_callbacks.unregister(object) end |
#with_triggered(ids_and_values) ⇒ Object
98 99 100 101 102 103 104 105 |
# File 'lib/wee/callback.rb', line 98 def with_triggered(ids_and_values) @input_callbacks.prepare_triggered(ids_and_values) @action_callbacks.prepare_triggered(ids_and_values) yield ensure @input_callbacks.reset_triggered @action_callbacks.reset_triggered end |