Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

landmark can't guarantee the delivery status names because it integra…

…tes with many different shipping carriers, so now we'll allow the ShipmentEvent class to hold the data for the entire event, so that someone can access all the data the event contained
  • Loading branch information...
commit bf2a1729a24ddc319b9eaef1eccdbb54e8e7fa02 1 parent bb42b12
@ricaurte ricaurte authored
View
4 lib/active_shipping/shipping/carriers/landmark.rb
@@ -156,7 +156,9 @@ def parse_tracking_response(response, options)
events = [package['Events']['Event']].flatten
shipment_events = events.map do |event|
time = Time.parse(event['DateTime'].gsub(/(\d{2})\/(\d{2})/, '\2/\1'))
- ShipmentEvent.new(event['Status'], time.utc, event['Location'])
+ shipment_event = ShipmentEvent.new(event['Status'], time.utc, event['Location'])
+ shipment_event.data = event
+ shipment_event
end
details = {
xml: response,
View
3  lib/active_shipping/shipping/shipment_event.rb
@@ -3,7 +3,8 @@ module Shipping
class ShipmentEvent
attr_reader :name, :time, :location, :message
-
+ attr_accessor :data
+
def initialize(name, time, location, message=nil)
@name, @time, @location, @message = name, time, location, message
end
Please sign in to comment.
Something went wrong with that request. Please try again.