Sha256: d37f11c4b095609e6a7c3c3445771b11e3cb733daf8fdfd15ca430f45820b3c7

Contents?: true

Size: 496 Bytes

Versions: 6

Compression:

Stored size: 496 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

6 entries across 6 versions & 1 rubygems

Version Path
cheap_ams-0.10.5 lib/active_model/serializer/association.rb
cheap_ams-0.10.4 lib/active_model/serializer/association.rb
cheap_ams-0.10.3 lib/active_model/serializer/association.rb
cheap_ams-0.10.2 lib/active_model/serializer/association.rb
cheap_ams-0.10.1 lib/active_model/serializer/association.rb
cheap_ams-0.10.0.rc2 lib/active_model/serializer/association.rb