Class: BlockProxy
Instance Method Summary collapse
-
#initialize(target, method, *args) ⇒ BlockProxy
constructor
A new instance of BlockProxy.
- #method_missing(method_name, *args, &block) ⇒ Object
- #proxy_args ⇒ Object
- #proxy_method ⇒ Object
- #proxy_target ⇒ Object
Constructor Details
#initialize(target, method, *args) ⇒ BlockProxy
Returns a new instance of BlockProxy.
25 26 27 28 29 |
# File 'lib/proxy_block.rb', line 25 def initialize(target, method, *args) @target = target @method = method @args = args end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
35 36 37 |
# File 'lib/proxy_block.rb', line 35 def method_missing(method_name, *args, &block) proxy_target.send(proxy_method, *proxy_args){ proxy_target.send(method_name, *args, &block) } end |