Created
February 27, 2013 14:35
-
-
Save raphink/5048314 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= | |
class MyHash < Hash | |
def to_yaml( opts = {} ) | |
YAML::quick_emit( self, opts ) do |out| | |
out.map( taguri, to_yaml_style ) do |map| | |
keys.sort.each do |k| | |
v = self[k] | |
map.add( k, v ) | |
end | |
end | |
end | |
end | |
end | |
myHash = MyHash[scope.to_hash.clone] | |
myHash.to_yaml | |
-%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment