def typecast_attribute(typecaster, value)
      raise ArgumentError, "a typecaster must be given" unless typecaster.respond_to?(:call)
      return value if value.nil?
      typecaster.call(value)
    end
def typecast_attribute(typecaster, value)
      raise ArgumentError, "a typecaster must be given" unless typecaster.respond_to?(:call)
      return value if value.nil?
      typecaster.call(value)
    end
Typecasts a value using a Class

 @param [#call] typecaster The typecaster to use for typecasting
 @param [Object] value The value to be typecasted

 @return [Object, nil] The typecasted value or nil if it cannot be
   typecasted

 @since 0.5.0