Module: Treat::Proxies::Proxy
Overview
Provides a base functionality for proxies.
Instance Method Summary collapse
-
#method_missing(sym, *args, &block) ⇒ Object
Build the entity corresponding to the proxied object and send the method call to the entity.
-
#to_entity(builder = nil) ⇒ Object
Create an unknown type of entity by default.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
Build the entity corresponding to the proxied object and send the method call to the entity.
11 12 13 14 15 16 17 18 |
# File 'lib/treat/proxies/proxy.rb', line 11 def method_missing(sym, *args, &block) if [:do, :apply].include?(sym) || Treat::Workers.lookup(sym) to_entity.send(sym, *args) else super(sym, *args, &block) end end |