From: Tim Mcd Date: 2008-12-20T10:02:21+09:00 Subject: YAML troubles I am working on a ruby MUD server, and I wanted to save a list of characters in a separate YAML file. The YAML file should contain a hash for each character, being something like this: {"charactername" => ["password", playerclassobject]} I wrote up two simple little characters into the YAML file: Test: - soccer - !ruby/object:Player id: :bob location: !ruby/object:Room contents: east: id: :center name: center north: south: west: name: bob --- Zonbi: - soccer - !ruby/object:Player id: :zonbi location: !ruby/object:Room contents: east: id: :center name: center north: south: west: name: zonbi Now when I try 'a = YAML::load(File.open('names.yaml'))', a only returns the first character set of data: {"Test"=>["soccer", #"bob", "id"=>:bob, "location"=>#"center", "east"=>nil, "id"=>:center, "south"=>nil, "west"=>nil, "contents"=>nil, "north"=>nil}>}>]} and doing 'a["Test"][1]' gives: #"bob", "id"=>:bob, "location"=>#"center", "east"=>nil, "id"=>:center, "south"=>nil, "west"=>nil, "contents"=>nil, "north"=>nil}>}>]} Instead of just in ...::Player:0x00000 or whatever it should be. Any help here? Thanks in advanced, Timothy. -- Posted via http://www.ruby-forum.com/.