Class: Clone

Inherits:
Object
  • Object
show all
Defined in:
lib/clone.rb

Overview

Note:

Not currently in use due to bug where “send” needs to be called directly on object, not indirectly through clone which results in “undefined method”.

A clone of the instance that a reflection calls methods on, as well as any other instances that those methods may lead to.

Instance Method Summary collapse

Constructor Details

#initialize(action) ⇒ Clone

Returns a new instance of Clone.



17
18
19
20
21
22
23
24
25
# File 'lib/clone.rb', line 17

def initialize(action)

  # Clone the action's calling object.
  @caller_object_clone = action.caller_object.clone

  # TODO: Clone any other instances that this clone references.
  # TODO: Replace clone's references to these new instances.

end

Instance Method Details

#action(method, *new_args) ⇒ Object



27
28
29
# File 'lib/clone.rb', line 27

def action(method, *new_args)
  @caller_object_clone.send(method, *new_args)
end