Module: ServiceOperation::Hooks::ClassMethods
- Defined in:
- lib/service_operation/hooks.rb
Overview
Hook Methods
Instance Method Summary collapse
- #after(*hooks, &block) ⇒ Object
- #after_hooks ⇒ Array<Symbol, Proc>
- #around(*hooks, &block) ⇒ Object
- #around_hooks ⇒ Array<Symbol, Proc>
- #before(*hooks, &block) ⇒ Object
- #before_hooks ⇒ Array<Symbol, Proc>
Instance Method Details
#after(*hooks, &block) ⇒ Object
29 30 31 |
# File 'lib/service_operation/hooks.rb', line 29 def after(*hooks, &block) add_hooks(:after, hooks, block, :unshift) end |
#after_hooks ⇒ Array<Symbol, Proc>
44 45 46 |
# File 'lib/service_operation/hooks.rb', line 44 def after_hooks @after_hooks ||= initial_hooks(:after_hooks) end |
#around(*hooks, &block) ⇒ Object
21 22 23 |
# File 'lib/service_operation/hooks.rb', line 21 def around(*hooks, &block) add_hooks(:around, hooks, block) end |
#around_hooks ⇒ Array<Symbol, Proc>
34 35 36 |
# File 'lib/service_operation/hooks.rb', line 34 def around_hooks @around_hooks ||= initial_hooks(:around_hooks) end |
#before(*hooks, &block) ⇒ Object
25 26 27 |
# File 'lib/service_operation/hooks.rb', line 25 def before(*hooks, &block) add_hooks(:before, hooks, block) end |
#before_hooks ⇒ Array<Symbol, Proc>
39 40 41 |
# File 'lib/service_operation/hooks.rb', line 39 def before_hooks @before_hooks ||= initial_hooks(:before_hooks) end |