Class: Rester::Service::Middleware::Ping

Inherits:
Base
  • Object
show all
Defined in:
lib/rester/service/middleware/ping.rb

Overview

Provides a basic status check. Used by the Client#connected? method.

Instance Attribute Summary

Attributes inherited from Base

#app, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize, #service

Constructor Details

This class inherits a constructor from Rester::Service::Middleware::Base

Instance Method Details

#call(env) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/rester/service/middleware/ping.rb', line 6

def call(env)
  if %r{\A/ping\z}.match(Rester.request.path_info)
    [200, {}, []]
  else
    super
  end
end