Sha256: 5bdcbeb53d5a1c5be02e1267533eabaf2520c935bb7a0d1500fd50a2e6720aad

Contents?: true

Size: 994 Bytes

Versions: 1

Compression:

Stored size: 994 Bytes

Contents

module FedexShip
  class TrackingInformation
    class Event
      attr_reader :description, :type, :occurred_at, :city, :state, :postal_code,
                  :country, :residential, :exception_code, :exception_description

      alias_method :occured_at, :occurred_at

      def initialize(details = {})
        @description           = details[:event_description]
        @type                  = details[:event_type]
        @occurred_at            = Time.parse(details[:timestamp])
        @city                  = details[:address][:city]
        @state                 = details[:address][:state_or_province_code]
        @postal_code           = details[:address][:postal_code]
        @country               = details[:address][:country_code]
        @residential           = details[:address][:residential] == "true"
        @exception_code        = details[:status_exception_code]
        @exception_description = details[:status_exception_description]
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fedex_ship-0.1.0 lib/fedex_ship/tracking_information/event.rb