ruby - Giving a YAML file more than one key, while only using one value for the keys -


i have issue need make yaml file contain following keys:

eta sol vets emc

from these keys need 1 value email address 4 of keys same email address, possible make yaml file more 1 key, , 1 value..?

for example:

agencies:          - eta          - sol          - vets          - emc             advocate_email: "example@example.com" #<= give these 4 same value          -          - other          - ones              advocate_email: "example1@example1.com" #<= give 3 value.. 1 , forth 

** update ** think have multiple emails , each group has longer list.

group1:   email: me@email.com   list:     - eta     - sol     - vets group2:   email: me2@email.com   list:     - 1     - 2     - 3 

** end update **

if understand correctly , want same email:

email: &email me@email.com  emails:   eta: *email   sol: *email   vets: *email 

output:

pry(main)> yaml.load(file.read('foo.yml')) => {"email"=>"me@email.com", "emails"=>{"eta"=>"me@email.com", "sol"=>"me@email.com", "vets"=>"me@email.com"}} 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo