Class: Amoeba::Cloner
- Inherits:
-
Object
- Object
- Amoeba::Cloner
- Extended by:
- Forwardable
- Defined in:
- lib/amoeba/cloner.rb
Instance Attribute Summary collapse
-
#new_object ⇒ Object
readonly
Returns the value of attribute new_object.
-
#object_klass ⇒ Object
readonly
Returns the value of attribute object_klass.
-
#old_object ⇒ Object
readonly
Returns the value of attribute old_object.
Instance Method Summary collapse
-
#initialize(object, options = {}) ⇒ Cloner
constructor
A new instance of Cloner.
- #run ⇒ Object
Constructor Details
#initialize(object, options = {}) ⇒ Cloner
Returns a new instance of Cloner.
16 17 18 19 20 21 22 |
# File 'lib/amoeba/cloner.rb', line 16 def initialize(object, = {}) @old_object = object @options = @object_klass = @old_object.class inherit_parent_settings @new_object = object.__send__(amoeba.dup_method) end |
Instance Attribute Details
#new_object ⇒ Object (readonly)
Returns the value of attribute new_object.
9 10 11 |
# File 'lib/amoeba/cloner.rb', line 9 def new_object @new_object end |
#object_klass ⇒ Object (readonly)
Returns the value of attribute object_klass.
9 10 11 |
# File 'lib/amoeba/cloner.rb', line 9 def object_klass @object_klass end |
#old_object ⇒ Object (readonly)
Returns the value of attribute old_object.
9 10 11 |
# File 'lib/amoeba/cloner.rb', line 9 def old_object @old_object end |
Instance Method Details
#run ⇒ Object
24 25 26 27 28 29 |
# File 'lib/amoeba/cloner.rb', line 24 def run process_overrides apply if amoeba.enabled after_apply if amoeba.do_preproc @new_object end |