Class: LazyMethods::Proxy

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

Overview

The proxy object does all the heavy lifting.

Direct Known Subclasses

AsyncProxy, LazyProxy

Constant Summary collapse

PROTECTED_METHODS =

These methods we don’t want to override. All other existing methods will be redefined.

%w(initialize method_missing __proxy_result__ __proxy_loaded__ __send__ __id__ object_id)

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object

All missing methods are proxied to the original result object.



90
91
92
# File 'lib/lazy_methods.rb', line 90

def method_missing(method, *args, &block)
  __proxy_result__.send(method, *args, &block)
end