lib/pdf/core/reference.rb
# Creates a deep copy of this ref. If +share+ is provided, shares the
# given dictionary entries between the old ref and the new.
#
Creates a deep copy of this ref. If +share+ is provided, shares the
given dictionary entries between the old ref and the new.
Creates a deep copy of this ref . If + share + is provided shares the given dictionary entries between the old ref and the new .
def deep_copy(share=[])
        r = dup
        case r.data
        when ::Hash
          (r.data.keys - share).each do |k|
            r.data[k] = Marshal.load(Marshal.dump(r.data[k]))
          end
        when PDF::Core::NameTree::Node
          r.data = r.data.deep_copy
        else
          r.data = Marshal.load(Marshal.dump(r.data))
        end
        r.stream = Marshal.load(Marshal.dump(r.stream))
        r
      end
def deep_copy ( share = [ ] ) r = dup case r . data when :: Hash ( r . data . keys - share ) . each do | k | r . data [ k ] = Marshal . load ( Marshal . dump ( r . data [ k ] ) ) end when PDF :: Core :: NameTree :: Node r . data = r . data . deep_copy else r . data = Marshal . load ( Marshal . dump ( r . data ) ) end r . stream = Marshal . load ( Marshal . dump ( r . stream ) ) r end
Creates a deep copy of this ref.
Creates a deep copy of this ref .
# Copy each entry not in +share+.
share
<not_specific>