From: "Jan E." Date: 2012-07-11T01:29:33+09:00 Subject: Re: read and store definitions from an outer file Hi, Using a Module as Jam suggested is probably the simplest way. But of course there are also many data formats you can use. I actually prefer JSON over YAML, because it's simpler and more "robust". Reading and writing works pretty much like with YAML: require 'json' config_file = 'config.json' # write new_config = { name: 'some name', address: 'some address' } File.open('config.json', 'w') {|f| f << new_config.to_json} #read current_config = JSON.parse File.read config_file puts current_config -- Posted via http://www.ruby-forum.com/.