Class: ActiveModel::Serializer::Association

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

Overview

This class holds all information about serializer’s association.

Examples:

Association.new(:comments, { serializer: CommentSummarySerializer })

Instance Attribute Summary collapse

Attributes inherited from Field

#block

Method Summary

Methods inherited from Field

#excluded?, #initialize, #value

Constructor Details

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

Instance Attribute Details

#nameSymbol

Returns the current value of name.

Returns:

  • (Symbol)

    the current value of name



12
13
14
# File 'lib/active_model/serializer/association.rb', line 12

def name
  @name
end

#optionsHash{Symbol => Object}

Returns the current value of options.

Returns:

  • (Hash{Symbol => Object})

    the current value of options



12
13
14
# File 'lib/active_model/serializer/association.rb', line 12

def options
  @options
end