@@ -48,6 +48,7 @@ def initialize(serializer, options = {})
48
48
end
49
49
50
50
# Build JSON API document.
51
+ # @return [Hash] document
51
52
def serializable_hash ( options = nil )
52
53
options ||= { }
53
54
@@ -83,7 +84,9 @@ def fragment_cache(cached_hash, non_cached_hash)
83
84
84
85
private
85
86
86
- # Build a pair of arrays containing the primary and included resources.
87
+ # Build the requested resource objects.
88
+ # @return [Array, Array] Pair of arrays containing primary and included
89
+ # resources objects respectively.
87
90
#
88
91
# @api private
89
92
def resource_objects_for ( serializer )
@@ -98,7 +101,8 @@ def resource_objects_for(serializer)
98
101
end
99
102
end
100
103
101
- # Build a Hash<ResourceIdentifier, ResourceObject> containing all requested resources (primary and included).
104
+ # Recursively build all requested resource objects.
105
+ # @return [Hash<ResourceIdentifier, ResourceObject>] Hash of resource objects keyed by resource identifiers.
102
106
#
103
107
# @api private
104
108
def _resource_objects_for ( serializer , include_tree , is_primary , hashes = { } )
@@ -125,6 +129,7 @@ def _resource_objects_for(serializer, include_tree, is_primary, hashes = {})
125
129
end
126
130
127
131
# Transform a serializer into a resource object.
132
+ # @return [Hash] resource object
128
133
#
129
134
# @api private
130
135
def resource_object_for ( serializer )
@@ -144,6 +149,7 @@ def resource_object_for(serializer)
144
149
end
145
150
146
151
# Get resource type.
152
+ # @return [String] type
147
153
#
148
154
# @api private
149
155
def resource_identifier_type_for ( serializer )
@@ -156,6 +162,7 @@ def resource_identifier_type_for(serializer)
156
162
end
157
163
158
164
# Get resource id.
165
+ # @return [String] id
159
166
#
160
167
# @api private
161
168
def resource_identifier_id_for ( serializer )
@@ -167,6 +174,7 @@ def resource_identifier_id_for(serializer)
167
174
end
168
175
169
176
# Get resource identifier.
177
+ # @return [Hash] resource identifier
170
178
#
171
179
# @api private
172
180
def resource_identifier_for ( serializer )
@@ -177,6 +185,7 @@ def resource_identifier_for(serializer)
177
185
end
178
186
179
187
# Get resource attributes.
188
+ # @return [Hash] attributes
180
189
#
181
190
# @api private
182
191
def attributes_for ( serializer )
@@ -189,6 +198,7 @@ def attributes_for(serializer)
189
198
end
190
199
191
200
# Get resource linkage for an association.
201
+ # @return [Hash] linkage
192
202
#
193
203
# @api private
194
204
def linkage_for ( serializer , options = { } )
@@ -204,6 +214,7 @@ def linkage_for(serializer, options = {})
204
214
end
205
215
206
216
# Get resource relationships.
217
+ # @return [Hash] relationships
207
218
#
208
219
# @api private
209
220
def relationships_for ( serializer )
0 commit comments