Class: JSONAPI::ResourcesSetOperationResult
- Inherits:
-
OperationResult
- Object
- OperationResult
- JSONAPI::ResourcesSetOperationResult
- Defined in:
- lib/jsonapi/operation_result.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#page_count ⇒ Object
Returns the value of attribute page_count.
-
#pagination_params ⇒ Object
Returns the value of attribute pagination_params.
-
#record_count ⇒ Object
Returns the value of attribute record_count.
-
#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 = {}) ⇒ ResourcesSetOperationResult
constructor
A new instance of ResourcesSetOperationResult.
- #to_hash(serializer) ⇒ Object
Constructor Details
#initialize(code, resource_set, options = {}) ⇒ ResourcesSetOperationResult
Returns a new instance of ResourcesSetOperationResult.
64 65 66 67 68 69 70 |
# File 'lib/jsonapi/operation_result.rb', line 64 def initialize(code, resource_set, = {}) @resource_set = resource_set @pagination_params = .fetch(:pagination_params, {}) @record_count = [:record_count] @page_count = [:page_count] super(code, ) end |
Instance Attribute Details
#page_count ⇒ Object
Returns the value of attribute page_count.
62 63 64 |
# File 'lib/jsonapi/operation_result.rb', line 62 def page_count @page_count end |
#pagination_params ⇒ Object
Returns the value of attribute pagination_params.
62 63 64 |
# File 'lib/jsonapi/operation_result.rb', line 62 def pagination_params @pagination_params end |
#record_count ⇒ Object
Returns the value of attribute record_count.
62 63 64 |
# File 'lib/jsonapi/operation_result.rb', line 62 def record_count @record_count end |
#resource_set ⇒ Object
Returns the value of attribute resource_set.
62 63 64 |
# File 'lib/jsonapi/operation_result.rb', line 62 def resource_set @resource_set end |
Instance Method Details
#to_hash(serializer) ⇒ Object
72 73 74 75 76 77 78 79 80 |
# File 'lib/jsonapi/operation_result.rb', line 72 def to_hash(serializer) if serializer serializer.serialize_resource_set_to_hash_plural(resource_set) else # :nocov: {} # :nocov: end end |