lib/sensu/api/http_handler.rb
# Determine the allowed HTTP methods for a route. The route
# regular expressions and associated route method calls are
# provided by `ROUTES`. This method returns an array of HTTP
# methods that have a route that matches the HTTP request URI.
#
# @return [Array]
Determine the allowed HTTP methods for a route. The route
regular expressions and associated route method calls are
provided by `ROUTES`. This method returns an array of HTTP
methods that have a route that matches the HTTP request URI.
Determine the allowed HTTP methods for a route . The route regular expressions and associated route method calls are provided by ` ROUTES ` . This method returns an array of HTTP methods that have a route that matches the HTTP request URI .
def allowed_http_methods?
        ROUTES.map { |http_method, routes|
          match = routes.detect do |route|
            @http_request_uri =~ route[0]
          end
          match ? http_method : nil
        }.flatten.compact
      end
def allowed_http_methods? ROUTES . map { | http_method , routes | match = routes . detect do | route | @http_request_uri =~ route [ 0 ] end match ? http_method : nil } . flatten . compact end
Determine the allowed HTTP methods for a route.
Determine the allowed HTTP methods for a route .
None
Array