Class: PingPong
- Inherits:
-
Object
- Object
- PingPong
- Defined in:
- lib/ping_pong.rb,
lib/ping_pong/version.rb
Constant Summary collapse
- VERSION =
"1.0.0"
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ PingPong
constructor
A new instance of PingPong.
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 |