Skip to content

Instantly share code, notes, and snippets.

@kyuden
Created October 19, 2013 06:19
Show Gist options
  • Save kyuden/7052223 to your computer and use it in GitHub Desktop.
Save kyuden/7052223 to your computer and use it in GitHub Desktop.
class Object
def self.yaml_tag url
Psych.add_tag(url, self)
end
# FIXME: rename this to "to_yaml" when syck is removed
###
# call-seq: to_yaml(options = {})
#
# Convert an object to YAML. See Psych.dump for more information on the
# available +options+.
def psych_to_yaml options = {}
Psych.dump self, options
end
remove_method :to_yaml rescue nil
alias :to_yaml :psych_to_yaml
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment