class Fakeit::App::Helpers::ResponseBuilder

Public Class Methods

error(code, err) click to toggle source
# File lib/fakeit/app/helpers/response_builder.rb, line 6
          def error(code, err) = [code, { 'Content-Type' => 'application/json' }, [{ message: err.message }.to_json]]

          def not_found = [404, {}, ['Not Found']]

          def method_not_allowed = [405, {}, ['Method Not Allowed']]

          def unsupported_media_type = [415, {}, ['Unsupported Media Type']]

          def ok(body) = [200, { 'Content-Type' => 'application/json' }, [body.to_json]]
        end
      end
    end
  end
end
method_not_allowed(= [405, {}, ['Method Not Allowed']]) click to toggle source
# File lib/fakeit/app/helpers/response_builder.rb, line 10
      def method_not_allowed = [405, {}, ['Method Not Allowed']]

      def unsupported_media_type = [415, {}, ['Unsupported Media Type']]

      def ok(body) = [200, { 'Content-Type' => 'application/json' }, [body.to_json]]
    end
  end
end
not_found(= [404, {}, ['Not Found']]) click to toggle source
# File lib/fakeit/app/helpers/response_builder.rb, line 8
        def not_found = [404, {}, ['Not Found']]

        def method_not_allowed = [405, {}, ['Method Not Allowed']]

        def unsupported_media_type = [415, {}, ['Unsupported Media Type']]

        def ok(body) = [200, { 'Content-Type' => 'application/json' }, [body.to_json]]
      end
    end
  end
end
ok(body) click to toggle source
# File lib/fakeit/app/helpers/response_builder.rb, line 14
  def ok(body) = [200, { 'Content-Type' => 'application/json' }, [body.to_json]]
end
unsupported_media_type(= [415, {}, ['Unsupported Media Type']]) click to toggle source
# File lib/fakeit/app/helpers/response_builder.rb, line 12
    def unsupported_media_type = [415, {}, ['Unsupported Media Type']]

    def ok(body) = [200, { 'Content-Type' => 'application/json' }, [body.to_json]]
  end
end