Module: ApiHammer::Rails::HaltMethods

Included in:
ApiHammer::Rails
Defined in:
lib/api_hammer/halt.rb

Instance Method Summary collapse

Instance Method Details

#halt_accepted(body, render_options = {}) ⇒ Object

halt with status 202 Accepted, responding with the given body object



109
110
111
# File 'lib/api_hammer/halt.rb', line 109

def halt_accepted(body, render_options = {})
  halt(202, body, render_options)
end

#halt_already_reported(body, render_options = {}) ⇒ Object

halt with status 208 Already Reported, responding with the given body object



139
140
141
# File 'lib/api_hammer/halt.rb', line 139

def halt_already_reported(body, render_options = {})
  halt(208, body, render_options)
end

#halt_authentication_timeout(errors, render_options = {}) ⇒ Object

halt with status 419 Authentication Timeout, responding with the given errors object on the 'errors' key



284
285
286
# File 'lib/api_hammer/halt.rb', line 284

def halt_authentication_timeout(errors, render_options = {})
  halt_error(419, errors, render_options)
end

#halt_bad_gateway(errors, render_options = {}) ⇒ Object

halt with status 502 Bad Gateway, responding with the given errors object on the 'errors' key



354
355
356
# File 'lib/api_hammer/halt.rb', line 354

def halt_bad_gateway(errors, render_options = {})
  halt_error(502, errors, render_options)
end

#halt_bad_request(errors, render_options = {}) ⇒ Object

halt with status 400 Bad Request, responding with the given errors object on the 'errors' key



189
190
191
# File 'lib/api_hammer/halt.rb', line 189

def halt_bad_request(errors, render_options = {})
  halt_error(400, errors, render_options)
end

#halt_bandwidth_limit_exceeded(errors, render_options = {}) ⇒ Object

halt with status 509 Bandwidth Limit Exceeded, responding with the given errors object on the 'errors' key



389
390
391
# File 'lib/api_hammer/halt.rb', line 389

def halt_bandwidth_limit_exceeded(errors, render_options = {})
  halt_error(509, errors, render_options)
end

#halt_conflict(errors, render_options = {}) ⇒ Object

halt with status 409 Conflict, responding with the given errors object on the 'errors' key



234
235
236
# File 'lib/api_hammer/halt.rb', line 234

def halt_conflict(errors, render_options = {})
  halt_error(409, errors, render_options)
end

#halt_created(body, render_options = {}) ⇒ Object

halt with status 201 Created, responding with the given body object



104
105
106
# File 'lib/api_hammer/halt.rb', line 104

def halt_created(body, render_options = {})
  halt(201, body, render_options)
end

#halt_expectation_failed(errors, render_options = {}) ⇒ Object

halt with status 417 Expectation Failed, responding with the given errors object on the 'errors' key



274
275
276
# File 'lib/api_hammer/halt.rb', line 274

def halt_expectation_failed(errors, render_options = {})
  halt_error(417, errors, render_options)
end

#halt_failed_dependency(errors, render_options = {}) ⇒ Object

halt with status 424 Failed Dependency, responding with the given errors object on the 'errors' key



299
300
301
# File 'lib/api_hammer/halt.rb', line 299

def halt_failed_dependency(errors, render_options = {})
  halt_error(424, errors, render_options)
end

#halt_forbidden(errors, render_options = {}) ⇒ Object

halt with status 403 Forbidden, responding with the given errors object on the 'errors' key



204
205
206
# File 'lib/api_hammer/halt.rb', line 204

def halt_forbidden(errors, render_options = {})
  halt_error(403, errors, render_options)
end

#halt_found(body, render_options = {}) ⇒ Object

halt with status 302 Found, responding with the given body object



159
160
161
# File 'lib/api_hammer/halt.rb', line 159

def halt_found(body, render_options = {})
  halt(302, body, render_options)
end

#halt_gateway_timeout(errors, render_options = {}) ⇒ Object

halt with status 504 Gateway Timeout, responding with the given errors object on the 'errors' key



364
365
366
# File 'lib/api_hammer/halt.rb', line 364

def halt_gateway_timeout(errors, render_options = {})
  halt_error(504, errors, render_options)
end

#halt_gone(errors, render_options = {}) ⇒ Object

halt with status 410 Gone, responding with the given errors object on the 'errors' key



239
240
241
# File 'lib/api_hammer/halt.rb', line 239

def halt_gone(errors, render_options = {})
  halt_error(410, errors, render_options)
end

#halt_http_version_not_supported(errors, render_options = {}) ⇒ Object

halt with status 505 HTTP Version Not Supported, responding with the given errors object on the 'errors' key



369
370
371
# File 'lib/api_hammer/halt.rb', line 369

def halt_http_version_not_supported(errors, render_options = {})
  halt_error(505, errors, render_options)
end

#halt_im_a_teapot(errors, render_options = {}) ⇒ Object

halt with status 418 I'm a teapot, responding with the given errors object on the 'errors' key



279
280
281
# File 'lib/api_hammer/halt.rb', line 279

def halt_im_a_teapot(errors, render_options = {})
  halt_error(418, errors, render_options)
end

#halt_im_used(body, render_options = {}) ⇒ Object

halt with status 226 IM Used, responding with the given body object



144
145
146
# File 'lib/api_hammer/halt.rb', line 144

def halt_im_used(body, render_options = {})
  halt(226, body, render_options)
end

#halt_insufficient_storage(errors, render_options = {}) ⇒ Object

halt with status 507 Insufficient Storage, responding with the given errors object on the 'errors' key



379
380
381
# File 'lib/api_hammer/halt.rb', line 379

def halt_insufficient_storage(errors, render_options = {})
  halt_error(507, errors, render_options)
end

#halt_internal_server_error(errors, render_options = {}) ⇒ Object

halt with status 500 Internal Server Error, responding with the given errors object on the 'errors' key



344
345
346
# File 'lib/api_hammer/halt.rb', line 344

def halt_internal_server_error(errors, render_options = {})
  halt_error(500, errors, render_options)
end

#halt_length_required(errors, render_options = {}) ⇒ Object

halt with status 411 Length Required, responding with the given errors object on the 'errors' key



244
245
246
# File 'lib/api_hammer/halt.rb', line 244

def halt_length_required(errors, render_options = {})
  halt_error(411, errors, render_options)
end

#halt_locked(errors, render_options = {}) ⇒ Object

halt with status 423 Locked, responding with the given errors object on the 'errors' key



294
295
296
# File 'lib/api_hammer/halt.rb', line 294

def halt_locked(errors, render_options = {})
  halt_error(423, errors, render_options)
end

#halt_loop_detected(errors, render_options = {}) ⇒ Object

halt with status 508 Loop Detected, responding with the given errors object on the 'errors' key



384
385
386
# File 'lib/api_hammer/halt.rb', line 384

def halt_loop_detected(errors, render_options = {})
  halt_error(508, errors, render_options)
end

#halt_method_not_allowed(errors, render_options = {}) ⇒ Object

halt with status 405 Method Not Allowed, responding with the given errors object on the 'errors' key



214
215
216
# File 'lib/api_hammer/halt.rb', line 214

def halt_method_not_allowed(errors, render_options = {})
  halt_error(405, errors, render_options)
end

#halt_moved_permanently(body, render_options = {}) ⇒ Object

halt with status 301 Moved Permanently, responding with the given body object



154
155
156
# File 'lib/api_hammer/halt.rb', line 154

def halt_moved_permanently(body, render_options = {})
  halt(301, body, render_options)
end

#halt_multi_status(body, render_options = {}) ⇒ Object

halt with status 207 Multi-Status, responding with the given body object



134
135
136
# File 'lib/api_hammer/halt.rb', line 134

def halt_multi_status(body, render_options = {})
  halt(207, body, render_options)
end

#halt_multiple_choices(body, render_options = {}) ⇒ Object

halt with status 300 Multiple Choices, responding with the given body object



149
150
151
# File 'lib/api_hammer/halt.rb', line 149

def halt_multiple_choices(body, render_options = {})
  halt(300, body, render_options)
end

#halt_network_authentication_required(errors, render_options = {}) ⇒ Object

halt with status 511 Network Authentication Required, responding with the given errors object on the 'errors' key



399
400
401
# File 'lib/api_hammer/halt.rb', line 399

def halt_network_authentication_required(errors, render_options = {})
  halt_error(511, errors, render_options)
end

#halt_no_content(render_options = {}) ⇒ Object

halt with status 204 No Content



119
120
121
# File 'lib/api_hammer/halt.rb', line 119

def halt_no_content(render_options = {})
  halt(204, '', render_options)
end

#halt_no_response(errors, render_options = {}) ⇒ Object

halt with status 444 No Response, responding with the given errors object on the 'errors' key



329
330
331
# File 'lib/api_hammer/halt.rb', line 329

def halt_no_response(errors, render_options = {})
  halt_error(444, errors, render_options)
end

#halt_non_authoritative_information(body, render_options = {}) ⇒ Object

halt with status 203 Non-Authoritative Information, responding with the given body object



114
115
116
# File 'lib/api_hammer/halt.rb', line 114

def halt_non_authoritative_information(body, render_options = {})
  halt(203, body, render_options)
end

#halt_not_acceptable(errors, render_options = {}) ⇒ Object

halt with status 406 Not Acceptable, responding with the given errors object on the 'errors' key



219
220
221
# File 'lib/api_hammer/halt.rb', line 219

def halt_not_acceptable(errors, render_options = {})
  halt_error(406, errors, render_options)
end

#halt_not_extended(errors, render_options = {}) ⇒ Object

halt with status 510 Not Extended, responding with the given errors object on the 'errors' key



394
395
396
# File 'lib/api_hammer/halt.rb', line 394

def halt_not_extended(errors, render_options = {})
  halt_error(510, errors, render_options)
end

#halt_not_found(errors, render_options = {}) ⇒ Object

halt with status 404 Not Found, responding with the given errors object on the 'errors' key



209
210
211
# File 'lib/api_hammer/halt.rb', line 209

def halt_not_found(errors, render_options = {})
  halt_error(404, errors, render_options)
end

#halt_not_implemented(errors, render_options = {}) ⇒ Object

halt with status 501 Not Implemented, responding with the given errors object on the 'errors' key



349
350
351
# File 'lib/api_hammer/halt.rb', line 349

def halt_not_implemented(errors, render_options = {})
  halt_error(501, errors, render_options)
end

#halt_not_modified(render_options = {}) ⇒ Object

halt with status 304 Not Modified



169
170
171
# File 'lib/api_hammer/halt.rb', line 169

def halt_not_modified(render_options = {})
  halt(304, '', render_options)
end

#halt_ok(body, render_options = {}) ⇒ Object

halt with status 200 OK, responding with the given body object



99
100
101
# File 'lib/api_hammer/halt.rb', line 99

def halt_ok(body, render_options = {})
  halt(200, body, render_options)
end

#halt_partial_content(body, render_options = {}) ⇒ Object

halt with status 206 Partial Content, responding with the given body object



129
130
131
# File 'lib/api_hammer/halt.rb', line 129

def halt_partial_content(body, render_options = {})
  halt(206, body, render_options)
end

#halt_payment_required(errors, render_options = {}) ⇒ Object

halt with status 402 Payment Required, responding with the given errors object on the 'errors' key



199
200
201
# File 'lib/api_hammer/halt.rb', line 199

def halt_payment_required(errors, render_options = {})
  halt_error(402, errors, render_options)
end

#halt_permanent_redirect(body, render_options = {}) ⇒ Object

halt with status 308 Permanent Redirect, responding with the given body object



184
185
186
# File 'lib/api_hammer/halt.rb', line 184

def halt_permanent_redirect(body, render_options = {})
  halt(308, body, render_options)
end

#halt_precondition_failed(errors, render_options = {}) ⇒ Object

halt with status 412 Precondition Failed, responding with the given errors object on the 'errors' key



249
250
251
# File 'lib/api_hammer/halt.rb', line 249

def halt_precondition_failed(errors, render_options = {})
  halt_error(412, errors, render_options)
end

#halt_precondition_required(errors, render_options = {}) ⇒ Object

halt with status 428 Precondition Required, responding with the given errors object on the 'errors' key



314
315
316
# File 'lib/api_hammer/halt.rb', line 314

def halt_precondition_required(errors, render_options = {})
  halt_error(428, errors, render_options)
end

#halt_proxy_authentication_required(errors, render_options = {}) ⇒ Object

halt with status 407 Proxy Authentication Required, responding with the given errors object on the 'errors' key



224
225
226
# File 'lib/api_hammer/halt.rb', line 224

def halt_proxy_authentication_required(errors, render_options = {})
  halt_error(407, errors, render_options)
end

#halt_redirect(errors, render_options = {}) ⇒ Object

halt with status 451 Redirect, responding with the given errors object on the 'errors' key



339
340
341
# File 'lib/api_hammer/halt.rb', line 339

def halt_redirect(errors, render_options = {})
  halt_error(451, errors, render_options)
end

#halt_request_entity_too_large(errors, render_options = {}) ⇒ Object

halt with status 413 Request Entity Too Large, responding with the given errors object on the 'errors' key



254
255
256
# File 'lib/api_hammer/halt.rb', line 254

def halt_request_entity_too_large(errors, render_options = {})
  halt_error(413, errors, render_options)
end

#halt_request_header_fields_too_large(errors, render_options = {}) ⇒ Object

halt with status 431 Request Header Fields Too Large, responding with the given errors object on the 'errors' key



324
325
326
# File 'lib/api_hammer/halt.rb', line 324

def halt_request_header_fields_too_large(errors, render_options = {})
  halt_error(431, errors, render_options)
end

#halt_request_timeout(errors, render_options = {}) ⇒ Object

halt with status 408 Request Timeout, responding with the given errors object on the 'errors' key



229
230
231
# File 'lib/api_hammer/halt.rb', line 229

def halt_request_timeout(errors, render_options = {})
  halt_error(408, errors, render_options)
end

#halt_request_uri_too_long(errors, render_options = {}) ⇒ Object

halt with status 414 Request-URI Too Long, responding with the given errors object on the 'errors' key



259
260
261
# File 'lib/api_hammer/halt.rb', line 259

def halt_request_uri_too_long(errors, render_options = {})
  halt_error(414, errors, render_options)
end

#halt_requested_range_not_satisfiable(errors, render_options = {}) ⇒ Object

halt with status 416 Requested Range Not Satisfiable, responding with the given errors object on the 'errors' key



269
270
271
# File 'lib/api_hammer/halt.rb', line 269

def halt_requested_range_not_satisfiable(errors, render_options = {})
  halt_error(416, errors, render_options)
end

#halt_reset_content(render_options = {}) ⇒ Object

halt with status 205 Reset Content



124
125
126
# File 'lib/api_hammer/halt.rb', line 124

def halt_reset_content(render_options = {})
  halt(205, '', render_options)
end

#halt_see_other(body, render_options = {}) ⇒ Object

halt with status 303 See Other, responding with the given body object



164
165
166
# File 'lib/api_hammer/halt.rb', line 164

def halt_see_other(body, render_options = {})
  halt(303, body, render_options)
end

#halt_service_unavailable(errors, render_options = {}) ⇒ Object

halt with status 503 Service Unavailable, responding with the given errors object on the 'errors' key



359
360
361
# File 'lib/api_hammer/halt.rb', line 359

def halt_service_unavailable(errors, render_options = {})
  halt_error(503, errors, render_options)
end

#halt_temporary_redirect(body, render_options = {}) ⇒ Object

halt with status 307 Temporary Redirect, responding with the given body object



179
180
181
# File 'lib/api_hammer/halt.rb', line 179

def halt_temporary_redirect(body, render_options = {})
  halt(307, body, render_options)
end

#halt_too_many_requests(errors, render_options = {}) ⇒ Object

halt with status 429 Too Many Requests, responding with the given errors object on the 'errors' key



319
320
321
# File 'lib/api_hammer/halt.rb', line 319

def halt_too_many_requests(errors, render_options = {})
  halt_error(429, errors, render_options)
end

#halt_unauthorized(errors, render_options = {}) ⇒ Object

halt with status 401 Unauthorized, responding with the given errors object on the 'errors' key



194
195
196
# File 'lib/api_hammer/halt.rb', line 194

def halt_unauthorized(errors, render_options = {})
  halt_error(401, errors, render_options)
end

halt with status 451 Unavailable For Legal Reasons, responding with the given errors object on the 'errors' key



334
335
336
# File 'lib/api_hammer/halt.rb', line 334

def halt_unavailable_for_legal_reasons(errors, render_options = {})
  halt_error(451, errors, render_options)
end

#halt_unordered_collection(errors, render_options = {}) ⇒ Object

halt with status 425 Unordered Collection, responding with the given errors object on the 'errors' key



304
305
306
# File 'lib/api_hammer/halt.rb', line 304

def halt_unordered_collection(errors, render_options = {})
  halt_error(425, errors, render_options)
end

#halt_unprocessable_entity(errors, render_options = {}) ⇒ Object

halt with status 422 Unprocessable Entity, responding with the given errors object on the 'errors' key



289
290
291
# File 'lib/api_hammer/halt.rb', line 289

def halt_unprocessable_entity(errors, render_options = {})
  halt_error(422, errors, render_options)
end

#halt_unsupported_media_type(errors, render_options = {}) ⇒ Object

halt with status 415 Unsupported Media Type, responding with the given errors object on the 'errors' key



264
265
266
# File 'lib/api_hammer/halt.rb', line 264

def halt_unsupported_media_type(errors, render_options = {})
  halt_error(415, errors, render_options)
end

#halt_upgrade_required(errors, render_options = {}) ⇒ Object

halt with status 426 Upgrade Required, responding with the given errors object on the 'errors' key



309
310
311
# File 'lib/api_hammer/halt.rb', line 309

def halt_upgrade_required(errors, render_options = {})
  halt_error(426, errors, render_options)
end

#halt_use_proxy(body, render_options = {}) ⇒ Object

halt with status 305 Use Proxy, responding with the given body object



174
175
176
# File 'lib/api_hammer/halt.rb', line 174

def halt_use_proxy(body, render_options = {})
  halt(305, body, render_options)
end

#halt_variant_also_negotiates(errors, render_options = {}) ⇒ Object

halt with status 506 Variant Also Negotiates, responding with the given errors object on the 'errors' key



374
375
376
# File 'lib/api_hammer/halt.rb', line 374

def halt_variant_also_negotiates(errors, render_options = {})
  halt_error(506, errors, render_options)
end