Reputation: 12378
Say I have:
h = {}
h[["one", "two"]] = "three"
# h = {["one", "two"]=>"three"}
How do I represent the above hash in YAML such that YAML.load_file('that_file')
will load the h
hash correctly?
Upvotes: 0
Views: 132
Reputation: 352
You can use to_yaml
method to preview this:
h = {}
h[["one", "two"]] = "three"
h.to_yaml
# => "---\n? - one\n - two\n: three\n"
Upvotes: 2