Skip to content

Commit

Permalink
Yarddoc.
Browse files Browse the repository at this point in the history
  • Loading branch information
beauby committed Oct 26, 2015
1 parent cbdf7f6 commit 3fdc17e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lib/active_model/serializer/adapter/json_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def initialize(serializer, options = {})
end

# Build JSON API document.
# @return [Hash] document
def serializable_hash(options = nil)
options ||= {}

Expand Down Expand Up @@ -83,7 +84,9 @@ def fragment_cache(cached_hash, non_cached_hash)

private

# Build a pair of arrays containing the primary and included resources.
# Build the requested resource objects.
# @return [Array, Array] Pair of arrays containing primary and included
# resources objects respectively.
#
# @api private
def resource_objects_for(serializer)
Expand All @@ -98,7 +101,8 @@ def resource_objects_for(serializer)
end
end

# Build a Hash<ResourceIdentifier, ResourceObject> containing all requested resources (primary and included).
# Recursively build all requested resource objects.
# @return [Hash<ResourceIdentifier, ResourceObject>] Hash of resource objects keyed by resource identifiers.
#
# @api private
def _resource_objects_for(serializer, include_tree, is_primary, hashes = {})
Expand All @@ -125,6 +129,7 @@ def _resource_objects_for(serializer, include_tree, is_primary, hashes = {})
end

# Transform a serializer into a resource object.
# @return [Hash] resource object
#
# @api private
def resource_object_for(serializer)
Expand All @@ -144,6 +149,7 @@ def resource_object_for(serializer)
end

# Get resource type.
# @return [String] type
#
# @api private
def resource_identifier_type_for(serializer)
Expand All @@ -156,6 +162,7 @@ def resource_identifier_type_for(serializer)
end

# Get resource id.
# @return [String] id
#
# @api private
def resource_identifier_id_for(serializer)
Expand All @@ -167,6 +174,7 @@ def resource_identifier_id_for(serializer)
end

# Get resource identifier.
# @return [Hash] resource identifier
#
# @api private
def resource_identifier_for(serializer)
Expand All @@ -177,6 +185,7 @@ def resource_identifier_for(serializer)
end

# Get resource attributes.
# @return [Hash] attributes
#
# @api private
def attributes_for(serializer)
Expand All @@ -189,6 +198,7 @@ def attributes_for(serializer)
end

# Get resource linkage for an association.
# @return [Hash] linkage
#
# @api private
def linkage_for(serializer, options = {})
Expand All @@ -204,6 +214,7 @@ def linkage_for(serializer, options = {})
end

# Get resource relationships.
# @return [Hash] relationships
#
# @api private
def relationships_for(serializer)
Expand Down

0 comments on commit 3fdc17e

Please sign in to comment.