lib/sensu/api/http_handler.rb
# Determine the route method for the HTTP request method and
# URI. The route regular expressions and associated route method
# calls are provided by `ROUTES`. This method will return the
# first route method name (Ruby symbol) that has matching URI
# regular expression. If an HTTP method is not supported, or
# there is not a matching regular expression, `nil` will be
# returned.
#
# @return [Symbol]
Determine the route method for the HTTP request method and
URI. The route regular expressions and associated route method
calls are provided by `ROUTES`. This method will return the
first route method name (Ruby symbol) that has matching URI
regular expression. If an HTTP method is not supported, or
there is not a matching regular expression, `nil` will be
returned.
Determine the route method for the HTTP request method and URI . The route regular expressions and associated route method calls are provided by ` ROUTES ` . This method will return the first route method name ( Ruby symbol ) that has matching URI regular expression . If an HTTP method is not supported or there is not a matching regular expression ` nil ` will be returned .
def determine_route_method
        if ROUTES.has_key?(@http_request_method)
          route = ROUTES[@http_request_method].detect do |route|
            @http_request_uri =~ route[0]
          end
          route ? route[1] : nil
        else
          nil
        end
      end
def determine_route_method if ROUTES . has_key? ( @http_request_method ) route = ROUTES [ @http_request_method ] . detect do | route | @http_request_uri =~ route [ 0 ] end route ? route [ 1 ] : nil else nil end end
Determine the route method for the HTTP request method and
URI.
Determine the route method for the HTTP request method and URI .
None
Symbol