Exception: ApiError
- Inherits:
-
StandardError
- Object
- StandardError
- ApiError
- Defined in:
- app/errors/api_error.rb
Direct Known Subclasses
YmlErrorResponder::ErrorsExampleController::Appointment, YmlErrorResponder::ErrorsExampleController::CvvInvalid
Instance Attribute Summary collapse
-
#meta ⇒ Object
readonly
Returns the value of attribute meta.
Instance Method Summary collapse
-
#initialize(meta: {}) ⇒ ApiError
constructor
A new instance of ApiError.
- #serialize ⇒ Object
Constructor Details
#initialize(meta: {}) ⇒ ApiError
Returns a new instance of ApiError.
4 5 6 |
# File 'app/errors/api_error.rb', line 4 def initialize(meta: {}) @meta = end |
Instance Attribute Details
#meta ⇒ Object (readonly)
Returns the value of attribute meta.
2 3 4 |
# File 'app/errors/api_error.rb', line 2 def @meta end |
Instance Method Details
#serialize ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'app/errors/api_error.rb', line 8 def serialize errors = instance_variables.each_with_object({}) do |exceptions, var| exceptions[var.to_s.gsub(/@/, '')] = instance_variable_get(var) exceptions end { errors: errors } end |