I looked through the YAML for ruby documentation and couldn't find an answer.
I have a list of several employees. Each has a name, phone, and email as such:
Employees:
Name | Phone | Email
john 111 a@b.com
joe 123 b@a.org
joan 321 c@a.net
How would I write the above information in YAML to end up with the following ruby output?
employees = [ {:name => 'john', :phone => '111', :email => 'a@b.com'}, {:name => 'joe', :phone => '123', :email => 'b@a.org'}, {:name => 'joan', :phone => '321', :email => 'c@a.net'} ]
This is how I parse the YAML file:
APP_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/config.yml")
Thank you!