Class: UspsApi::Error8
- Inherits:
-
Object
- Object
- UspsApi::Error8
- Defined in:
- lib/usps_api/models/error8.rb
Overview
See [The OAuth 2.0 Authorization Framework, Section 5.2](datatracker.ietf.org/doc/html/rfc6749#section-5.2), for information about the specific error codes.
Constant Summary collapse
- ERROR8 =
[ # TODO: Write general description for INVALID_REQUEST INVALID_REQUEST = 'invalid_request'.freeze, # TODO: Write general description for INVALID_CLIENT INVALID_CLIENT = 'invalid_client'.freeze, # TODO: Write general description for INVALID_GRANT INVALID_GRANT = 'invalid_grant'.freeze, # TODO: Write general description for UNAUTHORIZED_CLIENT UNAUTHORIZED_CLIENT = 'unauthorized_client'.freeze, # TODO: Write general description for UNSUPPORTED_GRANT_TYPE UNSUPPORTED_GRANT_TYPE = 'unsupported_grant_type'.freeze, # TODO: Write general description for INVALID_SCOPE INVALID_SCOPE = 'invalid_scope'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = INVALID_REQUEST) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/usps_api/models/error8.rb', line 37 def self.from_value(value, default_value = INVALID_REQUEST) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'invalid_request' then INVALID_REQUEST when 'invalid_client' then INVALID_CLIENT when 'invalid_grant' then INVALID_GRANT when 'unauthorized_client' then UNAUTHORIZED_CLIENT when 'unsupported_grant_type' then UNSUPPORTED_GRANT_TYPE when 'invalid_scope' then INVALID_SCOPE else default_value end end |
.validate(value) ⇒ Object
31 32 33 34 35 |
# File 'lib/usps_api/models/error8.rb', line 31 def self.validate(value) return false if value.nil? ERROR8.include?(value) end |