Class: RubyLogo

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

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ RubyLogo

Returns a new instance of RubyLogo.



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

def initialize(app)
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



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

def call(env)
  if env["REQUEST_URI"].include? "?=PHPE9568F34-D428-11d2-A769-00AA001ACF42"
    # Dump the ruby logo
    [200, {"Content-Type" => "image/png"}, File.open(File.expand_path("../../assets/php.gif", __FILE__))]
  else
    @app.call(env)
  end

end