Class: Sudo::MethodProxy
- Inherits:
-
Object
- Object
- Sudo::MethodProxy
- Defined in:
- lib/sudo/proxy.rb
Instance Method Summary collapse
-
#initialize(object, proxy) ⇒ MethodProxy
constructor
A new instance of MethodProxy.
- #method_missing(method = :itself, *args, &blk) ⇒ Object
Constructor Details
#initialize(object, proxy) ⇒ MethodProxy
Returns a new instance of MethodProxy.
5 6 7 8 |
# File 'lib/sudo/proxy.rb', line 5 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 = :itself, *args, &blk) ⇒ Object
9 10 11 |
# File 'lib/sudo/proxy.rb', line 9 def method_missing(method=:itself, *args, &blk) @proxy.proxy @object, method, *args, &blk end |