Class: DependencyInjection::ProxyObject
- Inherits:
-
Object
- Object
- DependencyInjection::ProxyObject
- Defined in:
- lib/dependency_injection/proxy_object.rb
Instance Method Summary collapse
-
#initialize(&block) ⇒ ProxyObject
constructor
A new instance of ProxyObject.
- #method_missing(method_name, *args) ⇒ Object
Constructor Details
#initialize(&block) ⇒ ProxyObject
Returns a new instance of ProxyObject.
3 4 5 |
# File 'lib/dependency_injection/proxy_object.rb', line 3 def initialize(&block) @object = block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
7 8 9 |
# File 'lib/dependency_injection/proxy_object.rb', line 7 def method_missing(method_name, *args) @object.call.send(method_name, *args) end |