Sha256: 35768a38d51e787ae15921597fc0ce494997ead94e403b9af2fd39276e1c478e
Contents?: true
Size: 797 Bytes
Versions: 22
Compression:
Stored size: 797 Bytes
Contents
# frozen_string_literal: true require_relative 'deserializer_type' module LedgerSync module Serialization module Type class DeserializerReferencesManyType < DeserializerType def cast_value(args = {}) deserializer_attribute = args.fetch(:deserializer_attribute) value = args.fetch(:value) resource = args.fetch(:resource) return if value.nil? first_dot = deserializer_attribute.resource_attribute_dot_parts.first.to_sym nested_resource = resource.class.resource_attributes[first_dot].type.resource_class.new value.map do |one_value| deserializer.new.deserialize(hash: one_value, resource: nested_resource) end end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems