Convert hash to configuration file : YAML « XML « Ruby






Convert hash to configuration file


require 'yaml'

puts ({ 'measurements' => 'metric' }.to_yaml)
puts ({ :measurements => :metric }.to_yaml)

 








Related examples in the same category

1.YAML Demo
2.use YAML::dump to convert your Person object array into YAML data
3.Output a hash with yaml
4.Reading and Writing Configuration Files
5.YAML for Marshaling