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.



138
139
140
141
# File 'lib/andand.rb', line 138

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



142
143
144
145
# File 'lib/andand.rb', line 142

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