Class: Sudo::MethodProxy

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

Instance Method Summary collapse

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