Class: ActiveModel::Serializer::Field

Inherits:
Struct
  • Object
show all
Defined in:
lib/active_model/serializer/field.rb

Overview

Holds all the meta-data about a field (i.e. attribute or association) as it was specified in the ActiveModel::Serializer class. Notice that the field block is evaluated in the context of the serializer.

Direct Known Subclasses

Attribute, Reflection

Instance Attribute Summary (collapse)

Instance Attribute Details

- (Object) block

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



6
7
8
# File 'lib/active_model/serializer/field.rb', line 6

def block
  @block
end

- (Object) name

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



6
7
8
# File 'lib/active_model/serializer/field.rb', line 6

def name
  @name
end

- (Object) options

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



6
7
8
# File 'lib/active_model/serializer/field.rb', line 6

def options
  @options
end