lib/grape/dsl/inside_route.rb
# Set or retrieve the HTTP status code.
#
# @param status [Integer] The HTTP Status Code to return for this request.
Set or retrieve the HTTP status code.
Set or retrieve the HTTP status code .
def status(status = nil)
        if status
          @status = status
        else
          return @status if @status
          case request.request_method.to_s.upcase
          when 'POST'
            201
          else
            200
          end
        end
      end
def status ( status = nil ) if status @status = status else return @status if @status case request . request_method . to_s . upcase when 'POST' 201 else 200 end end end
Set or retrieve the HTTP status code.
Set or retrieve the HTTP status code .
status
The HTTP Status Code to return for this request.
The HTTP Status Code to return for this request .