Class: Graphiti::Util::SerializerRelationship
- Defined in:
- lib/graphiti/util/serializer_relationships.rb
Class Method Summary collapse
-
.validated_link_cache ⇒ Object
If we can’t eagerly validate links on app boot, we do it at runtime To avoid any performance confusion, this caches that lookup.
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(resource_class, serializer, sideload) ⇒ SerializerRelationship
constructor
A new instance of SerializerRelationship.
Constructor Details
#initialize(resource_class, serializer, sideload) ⇒ SerializerRelationship
Returns a new instance of SerializerRelationship.
28 29 30 31 32 |
# File 'lib/graphiti/util/serializer_relationships.rb', line 28 def initialize(resource_class, serializer, sideload) @resource_class = resource_class @serializer = serializer @sideload = sideload end |
Class Method Details
.validated_link_cache ⇒ Object
If we can’t eagerly validate links on app boot, we do it at runtime To avoid any performance confusion, this caches that lookup
40 41 42 |
# File 'lib/graphiti/util/serializer_relationships.rb', line 40 def self.validated_link_cache @validated_link_cache ||= [] end |
Instance Method Details
#apply ⇒ Object
34 35 36 |
# File 'lib/graphiti/util/serializer_relationships.rb', line 34 def apply @serializer.relationship(@sideload.name, &block) end |