title: How do I parse YAML into a hash/object?
body: <p>I have a YAML file with a few entries that look like this:</p>
  
  <pre><code>001:
    :title: Some title
    :description: Some body text maybe
  002:
    :title: Some title
    :description: Some body text maybe
  </code></pre>
  
  <p>I'm using the following Ruby method to parse that YAML file into a set of objects I can iterate over:</p>
  
  <pre><code>def parse_yaml(file)
    YAML::load(File.open(File.join(settings.yaml_folder, file)))
  end
  
  def use_yaml
    @items = parse_yaml('items.yml')
    @items.each do |item|
      x = item[1][:title]
      etc...
    end
  end
  </code></pre>
  
  <p>Now, that method works, but I find it queer that I need to use <code>item[1][:title]</code> to access the attributes of the object I'm iterating over.  How can I build my YAML file or my parsing code to allow me to use the more standard <code>item[:title]</code>?</p>