Add :encode_with for proper YAML serialization