Class: ThriftRack::Ping
- Inherits:
-
Object
- Object
- ThriftRack::Ping
- Defined in:
- lib/thrift_rack/ping.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Ping
constructor
A new instance of Ping.
Constructor Details
#initialize(app) ⇒ Ping
Returns a new instance of Ping.
3 4 5 |
# File 'lib/thrift_rack/ping.rb', line 3 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
7 8 9 10 11 |
# File 'lib/thrift_rack/ping.rb', line 7 def call(env) req = Rack::Request.new(env) return 200, {'Content-Type' => 'text/plain'}, ["PONG"] if req.path == "/ping" @app.call(env) end |