Skip to content

Instantly share code, notes, and snippets.

@raphink
Created February 27, 2013 14:35
Show Gist options
  • Save raphink/5048314 to your computer and use it in GitHub Desktop.
Save raphink/5048314 to your computer and use it in GitHub Desktop.
<%=
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