Class: PingPong

Inherits:
Object
  • Object
show all
Defined in:
lib/ping_pong.rb,
lib/ping_pong/version.rb

Constant Summary collapse

VERSION =
"1.0.0"

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ PingPong

Returns a new instance of PingPong.



5
6
7
# File 'lib/ping_pong.rb', line 5

def initialize app
  @app = app
end

Instance Method Details

#call(env) ⇒ Object



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

def call env
  if env['PATH_INFO'] == '/__ping__'
    [200,{ 'Content-Type' => 'text/plain' },['PONG!']]
  else
    @app.call env
  end
end