Class: Oldskool::UrlHandler
- Inherits:
-
Object
- Object
- Oldskool::UrlHandler
- Defined in:
- lib/oldskool/url_handler.rb
Instance Method Summary collapse
- #handle_request(keyword, query) ⇒ Object
-
#initialize(params, keyword, config) ⇒ UrlHandler
constructor
A new instance of UrlHandler.
Constructor Details
#initialize(params, keyword, config) ⇒ UrlHandler
Returns a new instance of UrlHandler.
3 4 5 6 7 8 |
# File 'lib/oldskool/url_handler.rb', line 3 def initialize(params, keyword, config) @params = params @keyword = keyword @config = config self end |
Instance Method Details
#handle_request(keyword, query) ⇒ Object
10 11 12 13 14 |
# File 'lib/oldskool/url_handler.rb', line 10 def handle_request(keyword, query) url = @keyword[:url].gsub(/%Q%/, URI.escape(query)) {:template => :redirect, :url => url} end |