Sha256: 99b1b75ed057d6dec8ecef933a861664482228ee35c3a1bb0d70a1253a579cba
Contents?: true
Size: 855 Bytes
Versions: 32
Compression:
Stored size: 855 Bytes
Contents
# Overloads the {Object} class providing a {#deep_clone} method. # # @author Tasos "Zapotek" Laskos <tasos.laskos@gmail.com> class Object # Deep-clones self using a Marshal dump-load. # # @return [Object] # Duplicate of self. def deep_clone Marshal.load( Marshal.dump( self ) ) end def rpc_clone if self.class.respond_to?( :from_rpc_data ) self.class.from_rpc_data( Cuboid::RPC::Serializer.serializer.load( Cuboid::RPC::Serializer.serializer.dump( to_rpc_data ) ) ) else Cuboid::RPC::Serializer.serializer.load( Cuboid::RPC::Serializer.serializer.dump( self ) ) end end def to_rpc_data_or_self respond_to?( :to_rpc_data ) ? to_rpc_data : self end end
Version data entries
32 entries across 32 versions & 1 rubygems