Sha256: 7ad8c81ee6a992954fedaaacefd0266c1bff1917ffefc573335b780422849bb6

Contents?: true

Size: 348 Bytes

Versions: 1

Compression:

Stored size: 348 Bytes

Contents

module Rack
  class ContentManager
    def initialize(app)
      @app = app
    end

    def call(env)
      item = ContentItem.find_first_by_url(env["REQUEST_PATH"])
      unless item.nil?
        response = Rack::Response.new
        response.write "Hi there"
        response.finish
      else
        @app.call(env)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sethyates-content_manager-0.3.2 lib/rack/content_manager.rb