Class: JSONAPI::RelatedResourcesSetOperationResult
- Inherits:
-
ResourcesSetOperationResult
- Object
- OperationResult
- ResourcesSetOperationResult
- JSONAPI::RelatedResourcesSetOperationResult
- Defined in:
- lib/jsonapi/operation_result.rb
Instance Attribute Summary collapse
-
#_type ⇒ Object
Returns the value of attribute _type.
-
#resource_set ⇒ Object
Returns the value of attribute resource_set.
-
#source_resource ⇒ Object
Returns the value of attribute source_resource.
Attributes inherited from ResourcesSetOperationResult
#page_count, #pagination_params, #record_count
Attributes inherited from OperationResult
#code, #links, #meta, #options, #warnings
Instance Method Summary collapse
-
#initialize(code, source_resource, type, resource_set, options = {}) ⇒ RelatedResourcesSetOperationResult
constructor
A new instance of RelatedResourcesSetOperationResult.
- #to_hash(serializer = nil) ⇒ Object
Constructor Details
#initialize(code, source_resource, type, resource_set, options = {}) ⇒ RelatedResourcesSetOperationResult
Returns a new instance of RelatedResourcesSetOperationResult.
86 87 88 89 90 |
# File 'lib/jsonapi/operation_result.rb', line 86 def initialize(code, source_resource, type, resource_set, = {}) @source_resource = source_resource @_type = type super(code, resource_set, ) end |
Instance Attribute Details
#_type ⇒ Object
Returns the value of attribute _type.
84 85 86 |
# File 'lib/jsonapi/operation_result.rb', line 84 def _type @_type end |
#resource_set ⇒ Object
Returns the value of attribute resource_set.
84 85 86 |
# File 'lib/jsonapi/operation_result.rb', line 84 def resource_set @resource_set end |
#source_resource ⇒ Object
Returns the value of attribute source_resource.
84 85 86 |
# File 'lib/jsonapi/operation_result.rb', line 84 def source_resource @source_resource end |
Instance Method Details
#to_hash(serializer = nil) ⇒ Object
92 93 94 95 96 97 98 99 100 |
# File 'lib/jsonapi/operation_result.rb', line 92 def to_hash(serializer = nil) if serializer serializer.(resource_set, source_resource) else # :nocov: {} # :nocov: end end |