Class: Wayfarer::Middleware::UriParser
- Inherits:
-
Object
- Object
- Wayfarer::Middleware::UriParser
- Extended by:
- Base
- Defined in:
- lib/wayfarer/middleware/uri_parser.rb
Defined Under Namespace
Modules: API
Constant Summary
Constants included from Base
Instance Method Summary collapse
Methods included from Base
Instance Method Details
#call(task) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/wayfarer/middleware/uri_parser.rb', line 18 def call(task) return (yield if block_given?) if task[:uri] begin task[:uri] = Addressable::URI.parse(task.url) rescue Addressable::URI::InvalidURIError => e return log(:invalid, task, message: e.) end yield if block_given? end |