1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/yaml/types.rb: Likewise, pass self to YAML::quick_emit.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
why 2007-11-15 18:03:26 +00:00
parent 2fb73a8b0a
commit 91e0600535
2 changed files with 7 additions and 3 deletions

View file

@ -1,3 +1,7 @@
Fri Nov 16 03:01:00 2007 why the lucky stiff <why@ruby-lang.org>
* lib/yaml/types.rb: Likewise, pass self to YAML::quick_emit.
Fri Nov 16 02:51:59 2007 why the lucky stiff <why@ruby-lang.org>
* lib/yaml.rb (quick_emit): use combination of object_id and hash to

View file

@ -47,7 +47,7 @@ module YAML
class Object
def self.tag_subclasses?; false; end
def to_yaml( opts = {} )
YAML::quick_emit( object_id, opts ) do |out|
YAML::quick_emit( self, opts ) do |out|
out.map( "tag:ruby.yaml.org,2002:object:#{ @class }", to_yaml_style ) do |map|
@ivars.each do |k,v|
map.add( k, v )
@ -125,7 +125,7 @@ module YAML
true
end
def to_yaml( opts = {} )
YAML::quick_emit( self.object_id, opts ) do |out|
YAML::quick_emit( self, opts ) do |out|
out.seq( taguri, to_yaml_style ) do |seq|
self.each do |v|
seq.add( Hash[ *v ] )
@ -175,7 +175,7 @@ module YAML
true
end
def to_yaml( opts = {} )
YAML::quick_emit( self.object_id, opts ) do |out|
YAML::quick_emit( self, opts ) do |out|
out.seq( taguri, to_yaml_style ) do |seq|
self.each do |v|
seq.add( Hash[ *v ] )