Module: Resque::Reports::Extensions::EventCallbacks::ClassMethods
- Defined in:
- lib/resque/reports/extensions/event_callbacks.rb
Overview
TODO: сделать гибкой логику колбеков и хендлеров Defines callbacks
Instance Attribute Summary collapse
-
#error_callback ⇒ Object
readonly
Returns the value of attribute error_callback.
-
#progress_callback ⇒ Object
readonly
Returns the value of attribute progress_callback.
Instance Method Summary collapse
-
#on_error {|error| ... } ⇒ Object
Set callback on error.
-
#on_progress {|progress| ... } ⇒ Object
Set callback for watching progress of export.
Instance Attribute Details
#error_callback ⇒ Object (readonly)
Returns the value of attribute error_callback.
11 12 13 |
# File 'lib/resque/reports/extensions/event_callbacks.rb', line 11 def error_callback @error_callback end |
#progress_callback ⇒ Object (readonly)
Returns the value of attribute progress_callback.
11 12 13 |
# File 'lib/resque/reports/extensions/event_callbacks.rb', line 11 def progress_callback @progress_callback end |
Instance Method Details
#on_error {|error| ... } ⇒ Object
Set callback on error
28 29 30 |
# File 'lib/resque/reports/extensions/event_callbacks.rb', line 28 def on_error(&block) @error_callback = block end |
#on_progress {|progress| ... } ⇒ Object
Set callback for watching progress of export
21 22 23 |
# File 'lib/resque/reports/extensions/event_callbacks.rb', line 21 def on_progress(&block) @progress_callback = block end |