Module: Jerk::Base

Included in:
Ignore, Redirect
Defined in:
lib/jerk.rb

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



11
12
13
# File 'lib/jerk.rb', line 11

def call(env)
  @app.call(env)
end

#downcased_url(env) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/jerk.rb', line 22

def downcased_url(env)
  if env['QUERY_STRING'].empty?
    url_without_query_string(env).downcase
  else
    url_without_query_string(env).downcase + "?#{env['QUERY_STRING']}"
  end
end

#each(&block) ⇒ Object



15
# File 'lib/jerk.rb', line 15

def each(&block); end

#initialize(app) ⇒ Object



7
8
9
# File 'lib/jerk.rb', line 7

def initialize(app)
  @app = app
end

#url_without_query_string(env) ⇒ Object



17
18
19
20
# File 'lib/jerk.rb', line 17

def url_without_query_string(env)
  req = Rack::Request.new(env)
  req.base_url + req.script_name + req.path_info
end