Sha256: 07d26e51dc792cdb0e92b96581728e6a9968db1f8611e1f8b77c8aa452bb1914

Contents?: true

Size: 356 Bytes

Versions: 2

Compression:

Stored size: 356 Bytes

Contents

module Oldskool
  class UrlHandler
    include Rack::Utils

    def initialize(params, keyword, config)
      @params = params
      @keyword = keyword
      @config = config
      self
    end

    def handle_request(keyword, query)
      url = @keyword[:url].gsub(/%Q%/, escape_html(query))

      {:template => :redirect, :url => url}
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
oldskool-0.0.2 lib/oldskool/url_handler.rb
oldskool-0.0.1 lib/oldskool/url_handler.rb