Class: Shippinglogic::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/shippinglogic/proxy.rb

Direct Known Subclasses

Service

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#targetObject

Returns the value of attribute target.



10
11
12
# File 'lib/shippinglogic/proxy.rb', line 10

def target
  @target
end