Module: Humanoid::Collections::Mimic::ClassMethods
- Defined in:
- lib/humanoid/collections/mimic.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#proxy(target, operations) ⇒ Object
Proxy all the supplied operations to the internal collection or target.
Instance Method Details
#proxy(target, operations) ⇒ Object
Proxy all the supplied operations to the internal collection or target.
Example:
proxy Operations::ALL, :collection
35 36 37 38 39 40 41 42 |
# File 'lib/humanoid/collections/mimic.rb', line 35 def proxy(target, operations) operations.each do |name| define_method(name) do |*args| operation = lambda { send(target).send(name, *args) } attempt(operation, Time.now) end end end |