Sha256: 728e397f96b06ba455b969683a1e9b92a817e70b4670f9a99f2390cc0050e5bf

Contents?: true

Size: 638 Bytes

Versions: 14

Compression:

Stored size: 638 Bytes

Contents

require 'active_model/serializer/field'

module ActiveModel
  class Serializer
    # Holds all the meta-data about an attribute as it was specified in the
    # ActiveModel::Serializer class.
    #
    # @example
    #   class PostSerializer < ActiveModel::Serializer
    #     attribute :content
    #     attribute :name, key: :title
    #     attribute :email, key: :author_email, if: :user_logged_in?
    #     attribute :preview do
    #       truncate(object.content)
    #     end
    #
    #     def user_logged_in?
    #       current_user.logged_in?
    #     end
    #   end
    #
    class Attribute < Field
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
active_model_serializers-0.10.8 lib/active_model/serializer/attribute.rb
active_model_serializers-0.10.7 lib/active_model/serializer/attribute.rb
active_model_serializers-0.10.6 lib/active_model/serializer/attribute.rb
active_model_serializers-0.10.5 lib/active_model/serializer/attribute.rb
active_model_serializers-0.10.4 lib/active_model/serializer/attribute.rb
agi_active_model_serializers-0.10.9 lib/active_model/serializer/attribute.rb
agi_active_model_serializers-0.10.8 lib/active_model/serializer/attribute.rb
agi_active_model_serializers-0.10.7 lib/active_model/serializer/attribute.rb
active_model_serializers-0.10.3 lib/active_model/serializer/attribute.rb
active_model_serializers-0.10.2 lib/active_model/serializer/attribute.rb
active_model_serializers-0.10.1 lib/active_model/serializer/attribute.rb
active_model_serializers-0.10.0 lib/active_model/serializer/attribute.rb
active_model_serializers-0.10.0.rc5 lib/active_model/serializer/attribute.rb
active_model_serializers-0.10.0.rc4 lib/active_model/serializer/attribute.rb