Class: Yardcheck::Proxy
- Inherits:
- BasicObject
- Defined in:
- lib/yardcheck/proxy.rb
Instance Method Summary collapse
-
#initialize(target) ⇒ Proxy
constructor
A new instance of Proxy.
- #method_missing(method_name, *args, &block) ⇒ Object
Constructor Details
#initialize(target) ⇒ Proxy
Returns a new instance of Proxy.
5 6 7 |
# File 'lib/yardcheck/proxy.rb', line 5 def initialize(target) @target = target end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args, &block) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/yardcheck/proxy.rb', line 13 def method_missing(method_name, *args, &block) if target_respond_to?(method_name) @target.__send__(method_name, *args, &block) else ::Object .instance_method(method_name) .bind(@target) .call(*args, &block) end end |