class Rack::Hanoi

Public Class Methods

new(app) click to toggle source
# File lib/rack/hanoi.rb, line 5
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/rack/hanoi.rb, line 9
def call(env)
  return (if md = env["PATH_INFO"].match(%r|^/hanoi/(\d+)|)
            height = md[1].to_i
            HanoiApp.new(true, height).call(env)
          else
            @app.call(env)
          end)
end