Class: AndAnd::ProxyReturningMe

Inherits:
BlankSlate show all
Defined in:
lib/andand.rb

Overview

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

Instance Method Summary collapse

Methods inherited from BlankSlate

wipe

Constructor Details

#initialize(me) ⇒ ProxyReturningMe

Returns a new instance of ProxyReturningMe.



131
132
133
134
# File 'lib/andand.rb', line 131

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



135
136
137
138
# File 'lib/andand.rb', line 135

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