Skip to content

Instantly share code, notes, and snippets.

@nouse
Created December 26, 2011 15:25
Show Gist options
  • Save nouse/1521393 to your computer and use it in GitHub Desktop.
Save nouse/1521393 to your computer and use it in GitHub Desktop.
yaml tag
# results differently in ruby 1.8 and 1.9
require 'yaml'
class A; end
module B
class A
yaml_as "tag:ruby.yaml.org,2002:object:A"
end
end
obj = YAML.load("--- !ruby/object:A\n name: fun")
p obj.class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment