mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/delegate.rb (marshal_dump/load): Revert r26122, r26194, as per Nobu. [ruby-core:24211]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6696baf6c2
commit
91e1c13f11
2 changed files with 9 additions and 14 deletions
|
|
@ -1,3 +1,8 @@
|
|||
Tue Dec 29 11:20:41 2009 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||
|
||||
* lib/delegate.rb (marshal_dump/load): Revert r26122, r26194, as per
|
||||
Nobu. [ruby-core:24211]
|
||||
|
||||
Tue Dec 29 10:36:23 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* lib/rexml/parsers/baseparser.rb (REXML::Parsers::BaseParser::STANDALONE):
|
||||
|
|
|
|||
|
|
@ -178,22 +178,12 @@ class Delegator
|
|||
|
||||
# Serialization support for the object returned by \_\_getobj\_\_.
|
||||
def marshal_dump
|
||||
[
|
||||
:__v2__,
|
||||
instance_variables,
|
||||
instance_variables.map{|var| instance_variable_get(var)},
|
||||
__getobj__
|
||||
]
|
||||
__getobj__
|
||||
end
|
||||
# Reinitializes delegation from a serialized object.
|
||||
def marshal_load(data)
|
||||
version, vars, values, obj = data
|
||||
if version == :__v2__
|
||||
vars.each_with_index{|var, i| instance_variable_set(var, values[i])}
|
||||
__setobj__(obj)
|
||||
else
|
||||
__setobj__(data)
|
||||
end
|
||||
def marshal_load(obj)
|
||||
initialize_methods(obj)
|
||||
__setobj__(obj)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue