summaryrefslogtreecommitdiffstats
path: root/lib/yaml
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-20 02:40:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-20 02:40:15 +0000
commit41a119572ddfef63b46c3eb2ffdaf6fae3e7923a (patch)
treec110162265f9e79c0d4dc84323effd517757e91b /lib/yaml
parent6c8b089be852a4a88a053e6ff90c828b7d252eaf (diff)
downloadruby-41a119572ddfef63b46c3eb2ffdaf6fae3e7923a.tar.gz
ruby-41a119572ddfef63b46c3eb2ffdaf6fae3e7923a.tar.xz
ruby-41a119572ddfef63b46c3eb2ffdaf6fae3e7923a.zip
* lib/yaml.rb (YAML::YAML): adjust Marshal version.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/yaml')
-rw-r--r--lib/yaml/rubytypes.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/yaml/rubytypes.rb b/lib/yaml/rubytypes.rb
index a29c4fda8..0e5d5b17d 100644
--- a/lib/yaml/rubytypes.rb
+++ b/lib/yaml/rubytypes.rb
@@ -1,3 +1,4 @@
+# -*- mode: ruby; ruby-indent-level: 4; tab-width: 4 -*- vim: sw=4 ts=4
require 'date'
#
# Type conversions
@@ -23,7 +24,7 @@ class Object
YAML::quick_emit( self.object_id, opts ) { |out|
out.map( self.to_yaml_type ) { |map|
to_yaml_properties.each { |m|
- map.add( m[1..-1], instance_eval( m ) )
+ map.add( m[1..-1], instance_variable_get( m ) )
}
}
}
@@ -253,7 +254,7 @@ class Exception
out.map( self.to_yaml_type ) { |map|
map.add( 'message', self.message )
to_yaml_properties.each { |m|
- map.add( m[1..-1], instance_eval( m ) )
+ map.add( m[1..-1], instance_variable_get( m ) )
}
}
}
@@ -264,7 +265,7 @@ YAML.add_ruby_type( /^exception/ ) { |type, val|
type, obj_class = YAML.read_type_class( type, Exception )
o = YAML.object_maker( obj_class, { 'mesg' => val.delete( 'message' ) }, true )
val.each_pair { |k,v|
- o.instance_eval "@#{k} = v"
+ o.instance_variable_set("@#{k}", v)
}
o
}