module ActionDispatch::Routing::Mapper::HttpHelpers

def delete(*args, &block)

delete 'broccoli', to: 'food#broccoli'

For supported arguments, see match[rdoc-ref:Base#match]
Define a route that only recognizes HTTP DELETE.
def delete(*args, &block)
  map_method(:delete, args, &block)
end

def get(*args, &block)

get 'bacon', to: 'food#bacon'

For supported arguments, see match[rdoc-ref:Base#match]
Define a route that only recognizes HTTP GET.
def get(*args, &block)
  map_method(:get, args, &block)
end

def map_method(method, args, &block)

def map_method(method, args, &block)
  options = args.extract_options!
  options[:via] = method
  match(*args, options, &block)
  self
end

def options(*args, &block)

options 'carrots', to: 'food#carrots'

For supported arguments, see match[rdoc-ref:Base#match]
Define a route that only recognizes HTTP OPTIONS.
def options(*args, &block)
  map_method(:options, args, &block)
end

def patch(*args, &block)

patch 'bacon', to: 'food#bacon'

For supported arguments, see match[rdoc-ref:Base#match]
Define a route that only recognizes HTTP PATCH.
def patch(*args, &block)
  map_method(:patch, args, &block)
end

def post(*args, &block)

post 'bacon', to: 'food#bacon'

For supported arguments, see match[rdoc-ref:Base#match]
Define a route that only recognizes HTTP POST.
def post(*args, &block)
  map_method(:post, args, &block)
end

def put(*args, &block)

put 'bacon', to: 'food#bacon'

For supported arguments, see match[rdoc-ref:Base#match]
Define a route that only recognizes HTTP PUT.
def put(*args, &block)
  map_method(:put, args, &block)
end