Class: Couchbase::Model::DeepCopier
- Inherits:
-
Object
- Object
- Couchbase::Model::DeepCopier
- Defined in:
- lib/couchbase/model/deep_copier.rb
Instance Attribute Summary collapse
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #copy ⇒ Object
-
#initialize(source) ⇒ DeepCopier
constructor
A new instance of DeepCopier.
Constructor Details
#initialize(source) ⇒ DeepCopier
Returns a new instance of DeepCopier.
5 6 7 |
# File 'lib/couchbase/model/deep_copier.rb', line 5 def initialize(source) @source = source end |
Instance Attribute Details
#source ⇒ Object (readonly)
Returns the value of attribute source.
4 5 6 |
# File 'lib/couchbase/model/deep_copier.rb', line 4 def source @source end |
Instance Method Details
#copy ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/couchbase/model/deep_copier.rb', line 9 def copy if cloneable? if complex? deep_copy else source.clone end else source end end |