Class: Rack::Its::Spelled::Referrer

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/its/spelled/referrer.rb,
lib/rack/its/spelled/referrer/version.rb

Constant Summary collapse

VERSION =
"0.0.1"

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Referrer

Returns a new instance of Referrer.



7
8
9
# File 'lib/rack/its/spelled/referrer.rb', line 7

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/rack/its/spelled/referrer.rb', line 11

def call(env)
  referer = find_referer env

  return @app.call env unless referer

  fix_spelling env, referer

  return @app.call env
end