YAML::add_private_type( (Regexp or String) type_re, Proc transfer_proc )
Private types are intended to be a quick and informal typing mechanism. If, for example, you have a Hash that is storing employee data, but you want to be able to mark the Hash as containing structured employee data, you could give the Hash an '!!EmployeeList' private type, without needing any type of Ruby internal type to back it up.
YAML.add_domain_type( "hospital.com,2003", "Med" ) do |type, val| Medication.new( val ) end
Often, for simple private types, you don't even need to use the YAML::add_private_type method. Any private types found by the parser which aren't registered become objects of the PrivateType class, another convenient way of handling these special creatures.