Class: Rack::NakedToWww

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/naked-to-www.rb

Constant Summary collapse

VERSION =
"0.1.0"

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ NakedToWww

Returns a new instance of NakedToWww.



10
11
12
# File 'lib/rack/naked-to-www.rb', line 10

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/rack/naked-to-www.rb', line 14

def call(env)
  if naked?(env)
    redirect_to_www(env)
  else
    @app.call(env)
  end
end