Class: AndAnd::ProxyReturningMe
- Inherits:
-
BlankSlate
- Object
- BlankSlate
- AndAnd::ProxyReturningMe
- 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
-
#initialize(me) ⇒ ProxyReturningMe
constructor
A new instance of ProxyReturningMe.
- #method_missing(sym, *args, &block) ⇒ Object
Methods inherited from BlankSlate
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 |