Sha256: 48bf670d6c992c39d264b6e939b97d53935f6362d681a96575be3af7885999ba

Contents?: true

Size: 495 Bytes

Versions: 7

Compression:

Stored size: 495 Bytes

Contents

module ActiveModel
  class Serializer
    # This class hold all information about serializer's association.
    #
    # @param [Symbol] name
    # @param [ActiveModel::Serializer] serializer
    # @param [Hash{Symbol => Object}] options
    #
    # @example
    #  Association.new(:comments, CommentSummarySerializer)
    #
    Association = Struct.new(:name, :serializer, :options) do
      # @return [Symbol]
      #
      def key
        options.fetch(:key, name)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
active_model_serializers-0.10.0.rc4 lib/active_model/serializer/association.rb
active_model_serializers-0.10.0.rc3 lib/active_model/serializer/association.rb
cheap_ams-0.10.11 lib/active_model/serializer/association.rb
cheap_ams-0.10.10 lib/active_model/serializer/association.rb
cheap_ams-0.10.8 lib/active_model/serializer/association.rb
cheap_ams-0.10.7 lib/active_model/serializer/association.rb
cheap_ams-0.10.6 lib/active_model/serializer/association.rb