Class: Sudo::MethodProxy

Inherits:
Object show all
Defined in:
lib/sudo.rb

Instance Method Summary collapse

Constructor Details

#initialize(object, proxy) ⇒ MethodProxy

Returns a new instance of MethodProxy.



29
30
31
32
# File 'lib/sudo.rb', line 29

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



33
34
35
# File 'lib/sudo.rb', line 33

def method_missing(method=:self, *args, &blk)
  @proxy.proxy @object, method, *args, &blk
end