def call_remote_method(method_name, args)
m = @remote_methods[method_name]
base_uri = args.delete(:base_uri) || m.base_uri || ""
if args.has_key? :path
path = args.delete(:path)
else
path = m.interpolate_path_with_arguments(args)
end
path ||= ""
http_method = m.http_method
url = base_uri + path
options = m.merge_options(args)
proxy = memoized_proxy_object(http_method, url, options)
unless proxy
if m.cache_responses?
options[:cache] = @cache
options[:cache_key] = get_memcache_response_key(method_name, args)
options[:cache_timeout] = m.cache_ttl
end
proxy = send(http_method, url, options)
end
proxy
end