Class: ActiveModel::Serializer::Link

Inherits:
Field
  • Object
show all
Defined in:
lib/active_model/serializer/link.rb

Overview

Holds all the data about a serializer link

Examples:

class PostSerializer < ActiveModel::Serializer
  link :callback, if: :internal? do
    object.callback_link
  end

  def internal?
    instance_options[:internal] == true
  end
end

Instance Attribute Summary

Attributes inherited from Field

#block, #name, #options

Method Summary

Methods inherited from Field

#excluded?, #initialize, #value

Constructor Details

This class inherits a constructor from ActiveModel::Serializer::Field