Class: Nakajima::Object::InstanceMethods::ProxyReturningMe

Inherits:
BasicObject
Defined in:
lib/nakajima/core_ext/object.rb

Overview

A proxy that returns its target after invoking the method you invoke. Useful for #me

Instance Method Summary collapse

Constructor Details

#initialize(me) ⇒ ProxyReturningMe

Returns a new instance of ProxyReturningMe.



36
37
38
39
# File 'lib/nakajima/core_ext/object.rb', line 36

def initialize(me)
  super()
  @me = me
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &block) ⇒ Object



40
41
42
43
# File 'lib/nakajima/core_ext/object.rb', line 40

def method_missing(sym, *args, &block)
  @me.__send__(sym, *args, &block)
  @me
end