Class: JSONAPI::ResourceSetOperationResult
- Inherits:
-
OperationResult
- Object
- OperationResult
- JSONAPI::ResourceSetOperationResult
- Defined in:
- lib/jsonapi/operation_result.rb
Instance Attribute Summary collapse
-
#pagination_params ⇒ Object
Returns the value of attribute pagination_params.
-
#resource_set ⇒ Object
Returns the value of attribute resource_set.
Attributes inherited from OperationResult
#code, #links, #meta, #options, #warnings
Instance Method Summary collapse
-
#initialize(code, resource_set, options = {}) ⇒ ResourceSetOperationResult
constructor
A new instance of ResourceSetOperationResult.
- #to_hash(serializer) ⇒ Object
Constructor Details
#initialize(code, resource_set, options = {}) ⇒ ResourceSetOperationResult
Returns a new instance of ResourceSetOperationResult.
44 45 46 47 48 |
# File 'lib/jsonapi/operation_result.rb', line 44 def initialize(code, resource_set, = {}) @resource_set = resource_set @pagination_params = .fetch(:pagination_params, {}) super(code, ) end |
Instance Attribute Details
#pagination_params ⇒ Object
Returns the value of attribute pagination_params.
42 43 44 |
# File 'lib/jsonapi/operation_result.rb', line 42 def pagination_params @pagination_params end |
#resource_set ⇒ Object
Returns the value of attribute resource_set.
42 43 44 |
# File 'lib/jsonapi/operation_result.rb', line 42 def resource_set @resource_set end |
Instance Method Details
#to_hash(serializer) ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'lib/jsonapi/operation_result.rb', line 50 def to_hash(serializer) if serializer serializer.serialize_resource_set_to_hash_single(resource_set) else # :nocov: {} # :nocov: end end |