Class: JSONAPI::ErrorsOperationResult
- Inherits:
-
OperationResult
- Object
- OperationResult
- JSONAPI::ErrorsOperationResult
- Defined in:
- lib/jsonapi/operation_result.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
Returns the value of attribute errors.
Attributes inherited from OperationResult
#code, #links, #meta, #options, #warnings
Instance Method Summary collapse
-
#initialize(code, errors, options = {}) ⇒ ErrorsOperationResult
constructor
A new instance of ErrorsOperationResult.
- #to_hash(serializer = nil) ⇒ Object
Constructor Details
#initialize(code, errors, options = {}) ⇒ ErrorsOperationResult
Returns a new instance of ErrorsOperationResult.
27 28 29 30 |
# File 'lib/jsonapi/operation_result.rb', line 27 def initialize(code, errors, = {}) @errors = errors super(code, ) end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
25 26 27 |
# File 'lib/jsonapi/operation_result.rb', line 25 def errors @errors end |
Instance Method Details
#to_hash(serializer = nil) ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/jsonapi/operation_result.rb', line 32 def to_hash(serializer = nil) { errors: errors.collect do |error| # :nocov: error.to_hash # :nocov: end } end |