Class: Yp::Response::GatewayError::Factory
- Inherits:
-
Object
- Object
- Yp::Response::GatewayError::Factory
- Defined in:
- lib/response/gateway_error.rb
Class Method Summary collapse
Instance Method Summary collapse
- #error ⇒ Object
-
#initialize(code, message) ⇒ Factory
constructor
A new instance of Factory.
Constructor Details
#initialize(code, message) ⇒ Factory
Returns a new instance of Factory.
25 26 27 28 |
# File 'lib/response/gateway_error.rb', line 25 def initialize(code, ) @code = code @message = end |
Class Method Details
.error_map ⇒ Object
14 15 16 |
# File 'lib/response/gateway_error.rb', line 14 def error_map @error_map ||= load_error_map end |
Instance Method Details
#error ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/response/gateway_error.rb', line 30 def error if is_missing_field? MissingFieldError.new(missing_field) elsif is_invalid_field? InvalidFieldError.new(invalid_field) else GatewayError.new(@message) end end |