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



93
94
95
# File 'lib/api_hammer/halt.rb', line 93

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



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

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



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

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



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

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



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

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



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

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



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

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



88
89
90
# File 'lib/api_hammer/halt.rb', line 88

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



83
84
85
# File 'lib/api_hammer/halt.rb', line 83

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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



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

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