Created
September 26, 2014 18:37
-
-
Save pcg79/9bb8cf5d554645fcec33 to your computer and use it in GitHub Desktop.
Yaml file for music
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
genres: | |
- name: Classic Rock | |
artists: | |
- name: Led Zeppelin | |
albums: | |
- name: I | |
tracks: | |
- name: Babe, I'm Gonna Leave You | |
- name: Black Mountain Side | |
- name: Communication Breakdown | |
- name: Dazed And Confused | |
- name: Good Times, Bad Times | |
- name: How Many More Times | |
- name: I Can't Quit You Baby | |
- name: You Shook Me | |
- name: Your Time Is Gonna Come | |
- name: II | |
tracks: | |
- name: Bring It On Home | |
- name: Heartbreaker | |
- name: The Lemon Song | |
- name: Living Loving Maid | |
- name: Moby Dick | |
- name: Ramble On | |
- name: Thank You | |
- name: What Is And What Should Never Be | |
- name: Whole Lotta Love | |
- name: Jazz | |
artists: | |
- name: John Coltrane | |
albums: | |
- name: My Favorite Things | |
tracks: | |
- name: My Favorite Things | |
- name: Every Time We Say Goodbye | |
- name: Summertime | |
- name: But Not For Me | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given the a Yaml file of the format found in music.yaml parse the file so that we can access it in Ruby.
Your parsing code should return an object that allows you to access attributes using the [] operator:
The returned object should also allow you to access attributes using method calls: