Class: Shippinglogic::Proxy
- Inherits:
-
Object
- Object
- Shippinglogic::Proxy
- Defined in:
- lib/shippinglogic/proxy.rb
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (Object) target
Returns the value of attribute target.
Instance Method Summary (collapse)
-
- (Proxy) initialize(target)
constructor
A new instance of Proxy.
Constructor Details
- (Proxy) initialize(target)
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
- (Object) method_missing(name, *args, &block) (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
- (Object) target
Returns the value of attribute target
10 11 12 |
# File 'lib/shippinglogic/proxy.rb', line 10 def target @target end |