Module: PacTrac::Carrier

Defined in:
lib/pactrac/carrier.rb,
lib/pactrac/carrier/dhl.rb,
lib/pactrac/carrier/ems.rb

Defined Under Namespace

Modules: Dhl, Ems

Class Method Summary collapse

Class Method Details

.allObject



9
10
11
# File 'lib/pactrac/carrier.rb', line 9

def all
  [Carrier::Dhl, Carrier::Ems]
end

.for_tracking_number(tracking_number) ⇒ Object



13
14
15
16
17
18
# File 'lib/pactrac/carrier.rb', line 13

def for_tracking_number(tracking_number)
  all.each do |c|
    return Err.new(true), c if c.tracking_number_relevant?(tracking_number)
  end
  return Err.new(false, 'unable to match tracking number to carrier')
end