mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
20 lines
499 B
Ruby
20 lines
499 B
Ruby
module ActiveModel
|
|
class Serializer
|
|
# This class hold all information about serializer's association.
|
|
#
|
|
# @attr [Symbol] name
|
|
# @attr [ActiveModel::Serializer] serializer
|
|
# @attr [Hash{Symbol => Object}] options
|
|
#
|
|
# @example
|
|
# Association.new(:comments, CommentSummarySerializer)
|
|
#
|
|
Association = Struct.new(:name, :serializer, :options, :links, :meta) do
|
|
# @return [Symbol]
|
|
def key
|
|
options.fetch(:key, name)
|
|
end
|
|
end
|
|
end
|
|
end
|