Class: Transmutation::Attribute Private
- Defined in:
- lib/transmutation/attribute.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A plain attribute: either a block evaluated in the serializer's context, or a method sent to the serialized object.
Instance Attribute Summary
Attributes inherited from Field
Instance Method Summary collapse
Methods inherited from Field
Constructor Details
This class inherits a constructor from Transmutation::Field
Instance Method Details
#value(serializer, _options) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
9 10 11 |
# File 'lib/transmutation/attribute.rb', line 9 def value(serializer, ) block ? serializer.instance_exec(&block) : serializer.object.send(name) end |