Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DumpableProc
- def initialize( con_string )
- @code = con_string
- @__block = eval("Proc.new { |*args| #{@code} }")
- end
- def call( *args ) ; @__block.call( *args ) ; end
- def _dump( n ) ; @code ; end
- def self._load( con_string ) ; new( con_string ) ; end
- end
- pro = DumpableProc.new %q(
- puts "Hello World"
- )
- pro.call()
- pro = Marshal.load( Marshal.dump( pro ) )
- pro.call
Advertisement
Add Comment
Please, Sign In to add comment