Method: MiddleSquid::Adapter#handle
- Defined in:
- lib/middle_squid/adapter.rb
#handle(url, extras = []) ⇒ Object
Execute the user handler (see #handler) and calls #output.
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/middle_squid/adapter.rb', line 22 def handle(url, extras = []) uri = MiddleSquid::URI.parse url raise InvalidURIError, "invalid URL received: '#{url}'" if !uri || !uri.host action, = catch :action do @handler.call uri, extras throw :action, [:accept, {}] end output action, end |