Module: DeferrableActions
- Defined in:
- lib/deferrable_actions.rb,
lib/deferrable_actions/version.rb
Defined Under Namespace
Classes: Action
Constant Summary collapse
- VERSION =
"0.0.2"
Instance Method Summary collapse
- #defer!(method, args) ⇒ Object
- #defered_action? ⇒ Boolean
- #execute_defered_action! ⇒ Object
- #on_failure_execute_defered_action! ⇒ Object
Instance Method Details
#defer!(method, args) ⇒ Object
4 5 6 |
# File 'lib/deferrable_actions.rb', line 4 def defer!(method, args) Action.store(session, method, args) end |
#defered_action? ⇒ Boolean
8 9 10 |
# File 'lib/deferrable_actions.rb', line 8 def defered_action? Action.exists?(session) end |
#execute_defered_action! ⇒ Object
12 13 14 |
# File 'lib/deferrable_actions.rb', line 12 def execute_defered_action! Action.new(self).execute! if defered_action? end |
#on_failure_execute_defered_action! ⇒ Object
16 17 18 |
# File 'lib/deferrable_actions.rb', line 16 def on_failure_execute_defered_action! Action.new(self).on_failure_execute! if defered_action? end |