YAML and Saving

Hey, I have a quick question on using YAML or saving persistant-data
types. I have to write a class-level save method for the album class
that saves an @@album_list followed by .alb, as well as saving an
@@tag_list as tag_list.tags. How does YAML work, or what is the easiest
way to do this? What is the idea behind it?