Class: ShippingConnector::Dao
- Defined in:
- lib/shipping_connector/carrier/dao.rb
Instance Method Summary collapse
-
#initialize(customer_id, password) ⇒ Dao
constructor
Initializes a new carrier object for DAO.
-
#service_points(*arguments) ⇒ Object
Returns a list of service points or a single service point.
Methods inherited from Carrier
Constructor Details
#initialize(customer_id, password) ⇒ Dao
Initializes a new carrier object for DAO
11 12 13 14 |
# File 'lib/shipping_connector/carrier/dao.rb', line 11 def initialize( = {}) require! , :customer_id, :password super end |
Instance Method Details
#service_points(scope, zip_code, address, limit = 10) ⇒ Array<ServicePoint> #service_points(id) ⇒ ServicePoint
Returns a list of service points or a single service point. The returned distance is as the crow flies.
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/shipping_connector/carrier/dao.rb', line 26 def service_points(*arguments) scope = arguments.slice!(0) = arguments.slice!(0) || {} case scope when :list list_service_points() else find_service_point(scope) end end |