Class: Reflekt::Clone

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

Instance Method Summary collapse

Constructor Details

#initialize(action) ⇒ Clone

Returns a new instance of Clone.



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

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



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

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