Class: Graphiti::Util::SerializerRelationships
- Defined in:
- lib/graphiti/util/serializer_relationships.rb
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(resource_class, sideloads) ⇒ SerializerRelationships
constructor
A new instance of SerializerRelationships.
Constructor Details
#initialize(resource_class, sideloads) ⇒ SerializerRelationships
Returns a new instance of SerializerRelationships.
4 5 6 7 8 |
# File 'lib/graphiti/util/serializer_relationships.rb', line 4 def initialize(resource_class, sideloads) @resource_class = resource_class @serializer = @resource_class.serializer @sideloads = sideloads end |
Instance Method Details
#apply ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/graphiti/util/serializer_relationships.rb', line 10 def apply @sideloads.each_pair do |name, sideload| if apply?(sideload) SerializerRelationship .new(@resource_class, @serializer, sideload).apply end end end |