Class: Minidsl::Proxy
- Inherits:
- BasicObject
- Defined in:
- lib/minidsl/proxy.rb
Instance Method Summary collapse
-
#initialize(obj) ⇒ Proxy
constructor
A new instance of Proxy.
- #method_missing(sym, *args) ⇒ Object
Constructor Details
#initialize(obj) ⇒ Proxy
Returns a new instance of Proxy.
3 4 5 |
# File 'lib/minidsl/proxy.rb', line 3 def initialize(obj) @obj = obj end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args) ⇒ Object
7 8 9 |
# File 'lib/minidsl/proxy.rb', line 7 def method_missing(sym, *args) @obj.pure(sym).call(*args) end |