Class: ServeGridfsImage

Inherits:
Object
  • Object
show all
Defined in:
lib/serve_gridfs_image.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ ServeGridfsImage

Returns a new instance of ServeGridfsImage.



3
4
5
# File 'lib/serve_gridfs_image.rb', line 3

def initialize(app)
    @app = app
end

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/serve_gridfs_image.rb', line 7

def call(env)
  if env["PATH_INFO"] =~ /^\/grid\/(.+)$/
    process_request(env, $1)
  else
    @app.call(env)
  end
end