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.
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 |