class A
def get_handle
method(:test)
end
def test
@a = 1
end
end
File.open("test", "wb") {|file| Marshal.dump( A, file ) }
A.new.get_handle.call # 目前位置都可以运行
File.open("test", "rb") {|file| Marshal.load( file ) }
A.new.test # 可以运行
A.new.get_handle.call # Security Error.
class A
def get_handle
method(:test)
end
def test
@a = 1
end
end
File.open("test", "wb") {|file| Marshal.dump( A, file ) }
A.new.get_handle.call # 目前位置都可以运行
File.open("test", "rb") {|file| Marshal.load( file ) }
A.new.test # 可以运行
A.new.get_handle.call # Security Error.