#==============================================================================
# Dynamic Proxy
#==============================================================================
module DynamicProxy_Mixin
def self.included(base)
base.extend(Proxy_Methods)
end
module Proxy_Methods
def add_new_proxy(*args)
class_eval %{
def proxy_methods_targets
#{args}
end
def method_missing(name,*args,&block)
proxy_methods_targets.each{|target| target.send(name,*args,&block)}
end
}
end
end
end
#==============================================================================
# Dynamic Proxy
#==============================================================================
module DynamicProxy_Mixin
def self.included(base)
base.extend(Proxy_Methods)
end
module Proxy_Methods
def add_new_proxy(*args)
class_eval %{
def proxy_methods_targets
#{args}
end
def method_missing(name,*args,&block)
proxy_methods_targets.each{|target| target.send(name,*args,&block)}
end
}
end
end
end