Sha256: fd372d63b505a24eda4c4a965772eef17d3a8c1f7963b66c1cb470ed7dba8868
Contents?: true
Size: 754 Bytes
Versions: 10
Compression:
Stored size: 754 Bytes
Contents
module ActiveModel class Serializer module Meta extend ActiveSupport::Concern included do with_options instance_writer: false, instance_reader: true do |serializer| serializer.class_attribute :_meta # @api private end extend ActiveSupport::Autoload end module ClassMethods # Set the JSON API meta attribute of a serializer. # @example # class AdminAuthorSerializer < ActiveModel::Serializer # meta { stuff: 'value' } # @example # meta do # { comment_count: object.comments.count } # end def meta(value = nil, &block) self._meta = block || value end end end end end
Version data entries
10 entries across 10 versions & 2 rubygems