Module: Rack::App::SingletonMethods::Hooks
- Included in:
- Rack::App::SingletonMethods
- Defined in:
- lib/rack/app/singleton_methods/hooks.rb
Instance Method Summary collapse
Instance Method Details
#after(&block) ⇒ Object
9 10 11 12 13 |
# File 'lib/rack/app/singleton_methods/hooks.rb', line 9 def after(&block) @after_hooks ||= [] @after_hooks << block unless block.nil? @after_hooks end |
#before(&block) ⇒ Object
3 4 5 6 7 |
# File 'lib/rack/app/singleton_methods/hooks.rb', line 3 def before(&block) @before_hooks ||= [] @before_hooks << block unless block.nil? @before_hooks end |