Class: Factrey::Proxy
- Inherits:
- BasicObject
- Defined in:
- lib/factrey/proxy.rb
Overview
An intermediate object to provide some notation combined with method_missing
.
Instance Method Summary collapse
-
#initialize(receiver, method) ⇒ Proxy
constructor
A new instance of Proxy.
- #method_missing(method_name) ⇒ Object
Constructor Details
#initialize(receiver, method) ⇒ Proxy
Returns a new instance of Proxy.
18 19 20 21 |
# File 'lib/factrey/proxy.rb', line 18 def initialize(receiver, method) @receiver = receiver @method = method end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name) ⇒ Object
26 27 28 |
# File 'lib/factrey/proxy.rb', line 26 def method_missing(method_name, ...) @receiver.__send__(@method, method_name, ...) end |