Module: Fetch::Async
- Included in:
- Module
- Defined in:
- lib/fetch/async.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/fetch/async.rb', line 3 def self.included(base) base.define_callback :request, :defaults, :before_process, :after_process base.defaults do |req| req.before_process { before_process } if callback?(:before_process) req.after_process { after_process } if callback?(:after_process) req.failure { |code, url| failure(code, url) } if callback?(:failure) req.error { |e| error(e) } if callback?(:error) end end |