Skip to content

Instantly share code, notes, and snippets.

@jugyo
Created July 8, 2009 05:19
Show Gist options
  • Save jugyo/142606 to your computer and use it in GitHub Desktop.
Save jugyo/142606 to your computer and use it in GitHub Desktop.
require 'yaml'
yaml = <<YAML
---
default: &default
a: foo
b: bar
data1:
<<: *default
data2:
<<: *default
b: BAR
YAML
p YAML.load(yaml)
#=> {"default"=>{"a"=>"foo", "b"=>"bar"}, "data1"=>{"a"=>"foo", "b"=>"bar"}, "data2"=>{"a"=>"foo", "b"=>"BAR"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment