That string is escaped twice. There are a few ways to unescape it. The easiest is eval, though it is not safe if you don't trust the input. However if you're sure this is a string encoded by ruby:
print eval(str)
Safer:
print YAML.load(%Q(---\n"#{str}"\n))
If it was a string escaped by javascript:
print JSON.load(%Q("#{str}"))