def with_return_type(value)
      if value.nil? && allow_nil?
        if allow_nil?
          nil
        else
          # :nocov:
          raise ArgumentError, "Cannot return `nil` without allow_nil: true"
          # :nocov:
        end
      elsif @return_type == :symbol
        value.to_sym
      elsif @return_type == :string
        value.to_s
      end
    end
def with_return_type(value)
      if value.nil? && allow_nil?
        if allow_nil?
          nil
        else
          # :nocov:
          raise ArgumentError, "Cannot return `nil` without allow_nil: true"
          # :nocov:
        end
      elsif @return_type == :symbol
        value.to_sym
      elsif @return_type == :string
        value.to_s
      end
    end
Ensure the value is returned with the correct type
 @param [String, Symbol, nil] value
 @return [String, Symbol, nil]