From: Jeremy Bopp Date: 2011-02-02T12:18:56+09:00 Subject: Re: remove array bracket On 02/01/2011 09:04 PM, Kamarulnizam Rahim wrote: > class EnergyManagement < Environmental > def initialize(title) > @title = title > end > def objective > convert_yaml = Environmental.yaml #YAML::load_file('nizam.yaml') > convert_yaml["System"]["Environmental"]["children"][2]["children"] > << @title > File.open("nizam_out.yaml", "w"){|f| YAML.dump(convert_yaml, f)} > end > end > > e = EnergyManagement.new(tar) > e.objective At this point I can't see where the problem is since none of this correlates in an obvious way with your earlier posts. I think you need to simplify this whole thing into a basic test case using a stripped down and much simplified YAML file that reproduces the core problem. That way those of us here can try out your code, see exactly what you see, and ask you more intelligent question. :-) -Jeremy