Class: Metova::GenericError
- Inherits:
-
Object
- Object
- Metova::GenericError
- Includes:
- ActiveModel::Model
- Defined in:
- lib/metova/error.rb
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(error) ⇒ GenericError
constructor
A new instance of GenericError.
- #to_json ⇒ Object
Constructor Details
#initialize(error) ⇒ GenericError
Returns a new instance of GenericError.
5 6 7 |
# File 'lib/metova/error.rb', line 5 def initialize(error) @error = error end |
Instance Method Details
#errors ⇒ Object
9 10 11 |
# File 'lib/metova/error.rb', line 9 def errors [@error] end |
#to_json ⇒ Object
13 14 15 |
# File 'lib/metova/error.rb', line 13 def to_json(*) { errors: errors }.to_json end |