Class: Shippinglogic::FedEx::Service

Inherits:
Object
  • Object
show all
Includes:
HTTParty, Attributes, Request, Response, Validation
Defined in:
lib/shippinglogic/fedex/service.rb

Direct Known Subclasses

Cancel, Rate, Ship, Signature, Track

Constant Summary

Constants included from Response

Response::SUCCESSFUL_SEVERITIES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validation

#errors, #valid?

Methods included from Attributes

included

Constructor Details

#initialize(base, attributes = {}) ⇒ Service

Accepts the base service object as a single parameter so that we can access authentication credentials and options.



22
23
24
25
# File 'lib/shippinglogic/fedex/service.rb', line 22

def initialize(base, attributes = {})
  self.base = base
  super
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object (private)

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.



30
31
32
# File 'lib/shippinglogic/fedex/service.rb', line 30

def method_missing(name, *args, &block)
  target.send(name, *args, &block)
end

Instance Attribute Details

#baseObject

Returns the value of attribute base.



18
19
20
# File 'lib/shippinglogic/fedex/service.rb', line 18

def base
  @base
end