Sha256: 3239e4bff28d124d92042487be1aebefa419ec2b30a94218d23738f84954f6cc

Contents?: true

Size: 597 Bytes

Versions: 4

Compression:

Stored size: 597 Bytes

Contents

module Carousel
  class Tracking

    attr_accessor :carrier

    FEDEX    = "http://www.fedexuk.net/accounts/QuickTrack.aspx?consignment=:tracking_number"
    CAROUSEL = "https://web.carousel.eu/easyweb/default.asp?action=clienttrack&type=Carousel&acct1=BEC01&reference=:tracking_number"

    def initialize(carrier, tracking_number)
      @carrier         = carrier
      @tracking_number = tracking_number
    end

    def carrier_destination
      self.class.const_get(carrier.upcase)
    end

    def url
      carrier_destination.gsub(':tracking_number', @tracking_number)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
carousel-ruby-api-0.0.4 lib/carousel/tracking.rb
carousel-ruby-api-0.0.3 lib/carousel/tracking.rb
carousel-ruby-api-0.0.2 lib/carousel/tracking.rb
carousel-ruby-api-0.0.1 lib/carousel/tracking.rb