Class: Sudo::MethodProxy
Instance Method Summary collapse
-
#initialize(object, proxy) ⇒ MethodProxy
constructor
A new instance of MethodProxy.
- #method_missing(method = :self, *args, &blk) ⇒ Object
Constructor Details
#initialize(object, proxy) ⇒ MethodProxy
Returns a new instance of MethodProxy.
6 7 8 9 |
# File 'lib/sudo/proxy.rb', line 6 def initialize(object, proxy) @object = object @proxy = proxy end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method = :self, *args, &blk) ⇒ Object
10 11 12 |
# File 'lib/sudo/proxy.rb', line 10 def method_missing(method=:self, *args, &blk) @proxy.proxy @object, method, *args, &blk end |