In: |
yaml/rubytypes.rb
|
Parent: | Object |
Maps: Hash#to_yaml
# File yaml/rubytypes.rb, line 53 def to_yaml( opts = {} ) opts[:DocType] = self.class if Hash === opts YAML::quick_emit( self.object_id, opts ) { |out| hash_type = to_yaml_type if not out.options(:ExplicitTypes) and hash_type == "!map" hash_type = "" end out.map( hash_type ) { |map| # # Sort the hash # if out.options(:SortKeys) map.concat( self.sort ) else map.concat( self.to_a ) end } } end