Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/rweb.rb
Overview
Our default directives are contained in a Hash object. We would like to be able to copy that set of defaults without having the original changed, so we make up for a slight design deficiency in the Ruby standard library by providing a (somewhat limited) deep copy method.
Instance Method Summary collapse
-
#deep_copy ⇒ Object
Deep copy an object by first marshalling, then unmarshalling it.
Instance Method Details
#deep_copy ⇒ Object
Deep copy an object by first marshalling, then unmarshalling it.
30 31 32 |
# File 'lib/rweb.rb', line 30 def deep_copy Marshal.load(Marshal.dump(self)) end |