Class: Shippinglogic::Proxy
- Inherits:
-
Object
- Object
- Shippinglogic::Proxy
- Defined in:
- lib/shippinglogic/proxy.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(target) ⇒ Proxy
constructor
A new instance of Proxy.
Constructor Details
#initialize(target) ⇒ Proxy
Returns a new instance of Proxy.
12 13 14 |
# File 'lib/shippinglogic/proxy.rb', line 12 def initialize(target) self.target = target end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object (protected)
We undefined a lot of methods at the beginning of this class. The only methods present in this class are ones that we need, everything else is delegated to our target object.
19 20 21 |
# File 'lib/shippinglogic/proxy.rb', line 19 def method_missing(name, *args, &block) target.send(name, *args, &block) end |
Instance Attribute Details
#target ⇒ Object
Returns the value of attribute target.
10 11 12 |
# File 'lib/shippinglogic/proxy.rb', line 10 def target @target end |