Class: Verizon::HttpStatusCode
- Inherits:
-
Object
- Object
- Verizon::HttpStatusCode
- Defined in:
- lib/verizon/models/http_status_code.rb
Overview
HTML error code and description.
Constant Summary collapse
- HTTP_STATUS_CODE =
[ # TODO: Write general description for ENUM_100_CONTINUE ENUM_100_CONTINUE = '100 CONTINUE'.freeze, # TODO: Write general description for ENUM_101_SWITCHING_PROTOCOLS ENUM_101_SWITCHING_PROTOCOLS = '101 SWITCHING_PROTOCOLS'.freeze, # TODO: Write general description for ENUM_102_PROCESSING ENUM_102_PROCESSING = '102 PROCESSING'.freeze, # TODO: Write general description for ENUM_103_CHECKPOINT ENUM_103_CHECKPOINT = '103 CHECKPOINT'.freeze, # TODO: Write general description for ENUM_200_OK ENUM_200_OK = '200 OK'.freeze, # TODO: Write general description for ENUM_201_CREATED ENUM_201_CREATED = '201 CREATED'.freeze, # TODO: Write general description for ENUM_202_ACCEPTED ENUM_202_ACCEPTED = '202 ACCEPTED'.freeze, # TODO: Write general description for # ENUM_203_NON_AUTHORITATIVE_INFORMATION ENUM_203_NON_AUTHORITATIVE_INFORMATION = '203 NON_AUTHORITATIVE_INFORMATION'.freeze, # TODO: Write general description for ENUM_204_NO_CONTENT ENUM_204_NO_CONTENT = '204 NO_CONTENT'.freeze, # TODO: Write general description for ENUM_205_RESET_CONTENT ENUM_205_RESET_CONTENT = '205 RESET_CONTENT'.freeze, # TODO: Write general description for ENUM_206_PARTIAL_CONTENT ENUM_206_PARTIAL_CONTENT = '206 PARTIAL_CONTENT'.freeze, # TODO: Write general description for ENUM_207_MULTI_STATUS ENUM_207_MULTI_STATUS = '207 MULTI_STATUS'.freeze, # TODO: Write general description for ENUM_208_ALREADY_REPORTED ENUM_208_ALREADY_REPORTED = '208 ALREADY_REPORTED'.freeze, # TODO: Write general description for ENUM_226_IM_USED ENUM_226_IM_USED = '226 IM_USED'.freeze, # TODO: Write general description for ENUM_300_MULTIPLE_CHOICES ENUM_300_MULTIPLE_CHOICES = '300 MULTIPLE_CHOICES'.freeze, # TODO: Write general description for ENUM_301_MOVED_PERMANENTLY ENUM_301_MOVED_PERMANENTLY = '301 MOVED_PERMANENTLY'.freeze, # TODO: Write general description for ENUM_302_FOUND ENUM_302_FOUND = '302 FOUND'.freeze, # TODO: Write general description for ENUM_302_MOVED_TEMPORARILY ENUM_302_MOVED_TEMPORARILY = '302 MOVED_TEMPORARILY'.freeze, # TODO: Write general description for ENUM_303_SEE_OTHER ENUM_303_SEE_OTHER = '303 SEE_OTHER'.freeze, # TODO: Write general description for ENUM_304_NOT_MODIFIED ENUM_304_NOT_MODIFIED = '304 NOT_MODIFIED'.freeze, # TODO: Write general description for ENUM_305_USE_PROXY ENUM_305_USE_PROXY = '305 USE_PROXY'.freeze, # TODO: Write general description for ENUM_307_TEMPORARY_REDIRECT ENUM_307_TEMPORARY_REDIRECT = '307 TEMPORARY_REDIRECT'.freeze, # TODO: Write general description for ENUM_308_PERMANENT_REDIRECT ENUM_308_PERMANENT_REDIRECT = '308 PERMANENT_REDIRECT'.freeze, # TODO: Write general description for ENUM_400_BAD_REQUEST ENUM_400_BAD_REQUEST = '400 BAD_REQUEST'.freeze, # TODO: Write general description for ENUM_401_UNAUTHORIZED ENUM_401_UNAUTHORIZED = '401 UNAUTHORIZED'.freeze, # TODO: Write general description for ENUM_402_PAYMENT_REQUIRED ENUM_402_PAYMENT_REQUIRED = '402 PAYMENT_REQUIRED'.freeze, # TODO: Write general description for ENUM_403_FORBIDDEN ENUM_403_FORBIDDEN = '403 FORBIDDEN'.freeze, # TODO: Write general description for ENUM_404_NOT_FOUND ENUM_404_NOT_FOUND = '404 NOT_FOUND'.freeze, # TODO: Write general description for ENUM_405_METHOD_NOT_ALLOWED ENUM_405_METHOD_NOT_ALLOWED = '405 METHOD_NOT_ALLOWED'.freeze, # TODO: Write general description for ENUM_406_NOT_ACCEPTABLE ENUM_406_NOT_ACCEPTABLE = '406 NOT_ACCEPTABLE'.freeze, # TODO: Write general description for # ENUM_407_PROXY_AUTHENTICATION_REQUIRED ENUM_407_PROXY_AUTHENTICATION_REQUIRED = '407 PROXY_AUTHENTICATION_REQUIRED'.freeze, # TODO: Write general description for ENUM_408_REQUEST_TIMEOUT ENUM_408_REQUEST_TIMEOUT = '408 REQUEST_TIMEOUT'.freeze, # TODO: Write general description for ENUM_409_CONFLICT ENUM_409_CONFLICT = '409 CONFLICT'.freeze, # TODO: Write general description for ENUM_410_GONE ENUM_410_GONE = '410 GONE'.freeze, # TODO: Write general description for ENUM_411_LENGTH_REQUIRED ENUM_411_LENGTH_REQUIRED = '411 LENGTH_REQUIRED'.freeze, # TODO: Write general description for ENUM_412_PRECONDITION_FAILED ENUM_412_PRECONDITION_FAILED = '412 PRECONDITION_FAILED'.freeze, # TODO: Write general description for ENUM_413_PAYLOAD_TOO_LARGE ENUM_413_PAYLOAD_TOO_LARGE = '413 PAYLOAD_TOO_LARGE'.freeze, # TODO: Write general description for ENUM_413_REQUEST_ENTITY_TOO_LARGE ENUM_413_REQUEST_ENTITY_TOO_LARGE = '413 REQUEST_ENTITY_TOO_LARGE'.freeze, # TODO: Write general description for ENUM_414_URI_TOO_LONG ENUM_414_URI_TOO_LONG = '414 URI_TOO_LONG'.freeze, # TODO: Write general description for ENUM_414_REQUEST_URI_TOO_LONG ENUM_414_REQUEST_URI_TOO_LONG = '414 REQUEST_URI_TOO_LONG'.freeze, # TODO: Write general description for ENUM_415_UNSUPPORTED_MEDIA_TYPE ENUM_415_UNSUPPORTED_MEDIA_TYPE = '415 UNSUPPORTED_MEDIA_TYPE'.freeze, # TODO: Write general description for # ENUM_416_REQUESTED_RANGE_NOT_SATISFIABLE ENUM_416_REQUESTED_RANGE_NOT_SATISFIABLE = '416 REQUESTED_RANGE_NOT_SATISFIABLE'.freeze, # TODO: Write general description for ENUM_417_EXPECTATION_FAILED ENUM_417_EXPECTATION_FAILED = '417 EXPECTATION_FAILED'.freeze, # TODO: Write general description for ENUM_418_I_AM_A_TEAPOT ENUM_418_I_AM_A_TEAPOT = '418 I_AM_A_TEAPOT'.freeze, # TODO: Write general description for # ENUM_419_INSUFFICIENT_SPACE_ON_RESOURCE ENUM_419_INSUFFICIENT_SPACE_ON_RESOURCE = '419 INSUFFICIENT_SPACE_ON_RESOURCE'.freeze, # TODO: Write general description for ENUM_420_METHOD_FAILURE ENUM_420_METHOD_FAILURE = '420 METHOD_FAILURE'.freeze, # TODO: Write general description for ENUM_421_DESTINATION_LOCKED ENUM_421_DESTINATION_LOCKED = '421 DESTINATION_LOCKED'.freeze, # TODO: Write general description for ENUM_422_UNPROCESSABLE_ENTITY ENUM_422_UNPROCESSABLE_ENTITY = '422 UNPROCESSABLE_ENTITY'.freeze, # TODO: Write general description for ENUM_423_LOCKED ENUM_423_LOCKED = '423 LOCKED'.freeze, # TODO: Write general description for ENUM_424_FAILED_DEPENDENCY ENUM_424_FAILED_DEPENDENCY = '424 FAILED_DEPENDENCY'.freeze, # TODO: Write general description for ENUM_425_TOO_EARLY ENUM_425_TOO_EARLY = '425 TOO_EARLY'.freeze, # TODO: Write general description for ENUM_426_UPGRADE_REQUIRED ENUM_426_UPGRADE_REQUIRED = '426 UPGRADE_REQUIRED'.freeze, # TODO: Write general description for ENUM_428_PRECONDITION_REQUIRED ENUM_428_PRECONDITION_REQUIRED = '428 PRECONDITION_REQUIRED'.freeze, # TODO: Write general description for ENUM_429_TOO_MANY_REQUESTS ENUM_429_TOO_MANY_REQUESTS = '429 TOO_MANY_REQUESTS'.freeze, # TODO: Write general description for # ENUM_431_REQUEST_HEADER_FIELDS_TOO_LARGE ENUM_431_REQUEST_HEADER_FIELDS_TOO_LARGE = '431 REQUEST_HEADER_FIELDS_TOO_LARGE'.freeze, # TODO: Write general description for # ENUM_451_UNAVAILABLE_FOR_LEGAL_REASONS ENUM_451_UNAVAILABLE_FOR_LEGAL_REASONS = '451 UNAVAILABLE_FOR_LEGAL_REASONS'.freeze, # TODO: Write general description for ENUM_500_INTERNAL_SERVER_ERROR ENUM_500_INTERNAL_SERVER_ERROR = '500 INTERNAL_SERVER_ERROR'.freeze, # TODO: Write general description for ENUM_501_NOT_IMPLEMENTED ENUM_501_NOT_IMPLEMENTED = '501 NOT_IMPLEMENTED'.freeze, # TODO: Write general description for ENUM_502_BAD_GATEWAY ENUM_502_BAD_GATEWAY = '502 BAD_GATEWAY'.freeze, # TODO: Write general description for ENUM_503_SERVICE_UNAVAILABLE ENUM_503_SERVICE_UNAVAILABLE = '503 SERVICE_UNAVAILABLE'.freeze, # TODO: Write general description for ENUM_504_GATEWAY_TIMEOUT ENUM_504_GATEWAY_TIMEOUT = '504 GATEWAY_TIMEOUT'.freeze, # TODO: Write general description for ENUM_505_HTTP_VERSION_NOT_SUPPORTED ENUM_505_HTTP_VERSION_NOT_SUPPORTED = '505 HTTP_VERSION_NOT_SUPPORTED'.freeze, # TODO: Write general description for ENUM_506_VARIANT_ALSO_NEGOTIATES ENUM_506_VARIANT_ALSO_NEGOTIATES = '506 VARIANT_ALSO_NEGOTIATES'.freeze, # TODO: Write general description for ENUM_507_INSUFFICIENT_STORAGE ENUM_507_INSUFFICIENT_STORAGE = '507 INSUFFICIENT_STORAGE'.freeze, # TODO: Write general description for ENUM_508_LOOP_DETECTED ENUM_508_LOOP_DETECTED = '508 LOOP_DETECTED'.freeze, # TODO: Write general description for ENUM_509_BANDWIDTH_LIMIT_EXCEEDED ENUM_509_BANDWIDTH_LIMIT_EXCEEDED = '509 BANDWIDTH_LIMIT_EXCEEDED'.freeze, # TODO: Write general description for ENUM_510_NOT_EXTENDED ENUM_510_NOT_EXTENDED = '510 NOT_EXTENDED'.freeze, # TODO: Write general description for # ENUM_511_NETWORK_AUTHENTICATION_REQUIRED ENUM_511_NETWORK_AUTHENTICATION_REQUIRED = '511 NETWORK_AUTHENTICATION_REQUIRED'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = ENUM_100_CONTINUE) ⇒ Object
228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
# File 'lib/verizon/models/http_status_code.rb', line 228 def self.from_value(value, default_value = ENUM_100_CONTINUE) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'enum_100_continue' then ENUM_100_CONTINUE when 'enum_101_switching_protocols' then ENUM_101_SWITCHING_PROTOCOLS when 'enum_102_processing' then ENUM_102_PROCESSING when 'enum_103_checkpoint' then ENUM_103_CHECKPOINT when 'enum_200_ok' then ENUM_200_OK when 'enum_201_created' then ENUM_201_CREATED when 'enum_202_accepted' then ENUM_202_ACCEPTED when 'enum_203_non_authoritative_information' then ENUM_203_NON_AUTHORITATIVE_INFORMATION when 'enum_204_no_content' then ENUM_204_NO_CONTENT when 'enum_205_reset_content' then ENUM_205_RESET_CONTENT when 'enum_206_partial_content' then ENUM_206_PARTIAL_CONTENT when 'enum_207_multi_status' then ENUM_207_MULTI_STATUS when 'enum_208_already_reported' then ENUM_208_ALREADY_REPORTED when 'enum_226_im_used' then ENUM_226_IM_USED when 'enum_300_multiple_choices' then ENUM_300_MULTIPLE_CHOICES when 'enum_301_moved_permanently' then ENUM_301_MOVED_PERMANENTLY when 'enum_302_found' then ENUM_302_FOUND when 'enum_302_moved_temporarily' then ENUM_302_MOVED_TEMPORARILY when 'enum_303_see_other' then ENUM_303_SEE_OTHER when 'enum_304_not_modified' then ENUM_304_NOT_MODIFIED when 'enum_305_use_proxy' then ENUM_305_USE_PROXY when 'enum_307_temporary_redirect' then ENUM_307_TEMPORARY_REDIRECT when 'enum_308_permanent_redirect' then ENUM_308_PERMANENT_REDIRECT when 'enum_400_bad_request' then ENUM_400_BAD_REQUEST when 'enum_401_unauthorized' then ENUM_401_UNAUTHORIZED when 'enum_402_payment_required' then ENUM_402_PAYMENT_REQUIRED when 'enum_403_forbidden' then ENUM_403_FORBIDDEN when 'enum_404_not_found' then ENUM_404_NOT_FOUND when 'enum_405_method_not_allowed' then ENUM_405_METHOD_NOT_ALLOWED when 'enum_406_not_acceptable' then ENUM_406_NOT_ACCEPTABLE when 'enum_407_proxy_authentication_required' then ENUM_407_PROXY_AUTHENTICATION_REQUIRED when 'enum_408_request_timeout' then ENUM_408_REQUEST_TIMEOUT when 'enum_409_conflict' then ENUM_409_CONFLICT when 'enum_410_gone' then ENUM_410_GONE when 'enum_411_length_required' then ENUM_411_LENGTH_REQUIRED when 'enum_412_precondition_failed' then ENUM_412_PRECONDITION_FAILED when 'enum_413_payload_too_large' then ENUM_413_PAYLOAD_TOO_LARGE when 'enum_413_request_entity_too_large' then ENUM_413_REQUEST_ENTITY_TOO_LARGE when 'enum_414_uri_too_long' then ENUM_414_URI_TOO_LONG when 'enum_414_request_uri_too_long' then ENUM_414_REQUEST_URI_TOO_LONG when 'enum_415_unsupported_media_type' then ENUM_415_UNSUPPORTED_MEDIA_TYPE when 'enum_416_requested_range_not_satisfiable' then ENUM_416_REQUESTED_RANGE_NOT_SATISFIABLE when 'enum_417_expectation_failed' then ENUM_417_EXPECTATION_FAILED when 'enum_418_i_am_a_teapot' then ENUM_418_I_AM_A_TEAPOT when 'enum_419_insufficient_space_on_resource' then ENUM_419_INSUFFICIENT_SPACE_ON_RESOURCE when 'enum_420_method_failure' then ENUM_420_METHOD_FAILURE when 'enum_421_destination_locked' then ENUM_421_DESTINATION_LOCKED when 'enum_422_unprocessable_entity' then ENUM_422_UNPROCESSABLE_ENTITY when 'enum_423_locked' then ENUM_423_LOCKED when 'enum_424_failed_dependency' then ENUM_424_FAILED_DEPENDENCY when 'enum_425_too_early' then ENUM_425_TOO_EARLY when 'enum_426_upgrade_required' then ENUM_426_UPGRADE_REQUIRED when 'enum_428_precondition_required' then ENUM_428_PRECONDITION_REQUIRED when 'enum_429_too_many_requests' then ENUM_429_TOO_MANY_REQUESTS when 'enum_431_request_header_fields_too_large' then ENUM_431_REQUEST_HEADER_FIELDS_TOO_LARGE when 'enum_451_unavailable_for_legal_reasons' then ENUM_451_UNAVAILABLE_FOR_LEGAL_REASONS when 'enum_500_internal_server_error' then ENUM_500_INTERNAL_SERVER_ERROR when 'enum_501_not_implemented' then ENUM_501_NOT_IMPLEMENTED when 'enum_502_bad_gateway' then ENUM_502_BAD_GATEWAY when 'enum_503_service_unavailable' then ENUM_503_SERVICE_UNAVAILABLE when 'enum_504_gateway_timeout' then ENUM_504_GATEWAY_TIMEOUT when 'enum_505_http_version_not_supported' then ENUM_505_HTTP_VERSION_NOT_SUPPORTED when 'enum_506_variant_also_negotiates' then ENUM_506_VARIANT_ALSO_NEGOTIATES when 'enum_507_insufficient_storage' then ENUM_507_INSUFFICIENT_STORAGE when 'enum_508_loop_detected' then ENUM_508_LOOP_DETECTED when 'enum_509_bandwidth_limit_exceeded' then ENUM_509_BANDWIDTH_LIMIT_EXCEEDED when 'enum_510_not_extended' then ENUM_510_NOT_EXTENDED when 'enum_511_network_authentication_required' then ENUM_511_NETWORK_AUTHENTICATION_REQUIRED else default_value end end |
.validate(value) ⇒ Object
222 223 224 225 226 |
# File 'lib/verizon/models/http_status_code.rb', line 222 def self.validate(value) return false if value.nil? HTTP_STATUS_CODE.include?(value) end |