Class: RR::DoubleMethodProxy
- Inherits:
-
Object
- Object
- RR::DoubleMethodProxy
- Defined in:
- lib/rr/double_method_proxy.rb
Instance Method Summary collapse
-
#initialize(creator, object) {|_self| ... } ⇒ DoubleMethodProxy
constructor
:nodoc:.
Constructor Details
#initialize(creator, object) {|_self| ... } ⇒ DoubleMethodProxy
:nodoc:
3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rr/double_method_proxy.rb', line 3 def initialize(creator, object, &block) #:nodoc: @creator = creator @object = object class << self instance_methods.each do |m| undef_method m unless m =~ /^__/ end def method_missing(method_name, *args, &block) @creator.create!(@object, method_name, *args, &block) end end yield(self) if block_given? end |