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.
25 26 27 28 |
# File 'lib/jsonapi/operation_result.rb', line 25 def initialize(code, errors, = {}) @errors = errors super(code, ) end |
Instance Attribute Details
#errors ⇒ Object
Returns the value of attribute errors.
23 24 25 |
# File 'lib/jsonapi/operation_result.rb', line 23 def errors @errors end |
Instance Method Details
#to_hash(serializer = nil) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/jsonapi/operation_result.rb', line 30 def to_hash(serializer = nil) { errors: errors.collect do |error| # :nocov: error.to_hash # :nocov: end } end |