protected function processAttributeToResource($object, ResourceObject $resource, Attribute $definition)
    {
        $name   = $definition->getName();
        $getter = $definition->getGetter();

        $value = $object->$getter();

        if ($value === null && ! $definition->getProcessNull()) {
            return;
        }

        $value = $this->typeManager->toResource($definition, $value);

        $resource->setAttribute($name, $value);
    }