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.
14 15 16 17 18 19 |
# File 'lib/amoeba/cloner.rb', line 14 def initialize(object, = {}) @old_object, @options = object, @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.
7 8 9 |
# File 'lib/amoeba/cloner.rb', line 7 def new_object @new_object end |
#object_klass ⇒ Object (readonly)
Returns the value of attribute object_klass.
7 8 9 |
# File 'lib/amoeba/cloner.rb', line 7 def object_klass @object_klass end |
#old_object ⇒ Object (readonly)
Returns the value of attribute old_object.
7 8 9 |
# File 'lib/amoeba/cloner.rb', line 7 def old_object @old_object end |
Instance Method Details
#run ⇒ Object
21 22 23 24 25 26 |
# File 'lib/amoeba/cloner.rb', line 21 def run process_overrides apply if amoeba.enabled after_apply if amoeba.do_preproc @new_object end |