Method: RBPDF#objclone
- Defined in:
- lib/rbpdf.rb
#objclone(object) ⇒ Object
Creates a copy of a class object
- @param object :object
-
class object to be cloned
- @return
-
cloned object
- @access public
- @since 4.5.029 (2009-03-19)
16806 16807 16808 16809 16810 16811 16812 16813 16814 16815 16816 |
# File 'lib/rbpdf.rb', line 16806 def objclone(object) if @diskcache newobj = object.dup newobj.cache_file_length = object.cache_file_length.dup newobj.prev_pages = object.prev_pages.dup newobj.pages = object.pages.dup return newobj else return Marshal.load(Marshal.dump(object)) end end |