Class: Shipping::TrackingResync::Result

Inherits:
Data
  • Object
show all
Defined in:
app/services/shipping/tracking_resync.rb

Overview

Returns outcome of one resync attempt.

Returns:

  • (Data)

    outcome of one resync attempt

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(events: 0, webhook_log: nil, skipped_reason: nil) ⇒ Result

Builds one tracking-resync result.

Parameters:

  • events (Integer) (defaults to: 0)

    number of carrier events ingested

  • webhook_log (WebhookLog, nil) (defaults to: nil)

    processed synthetic webhook

  • skipped_reason (Symbol, nil) (defaults to: nil)

    reason no history was ingested



34
# File 'app/services/shipping/tracking_resync.rb', line 34

def initialize(events: 0, webhook_log: nil, skipped_reason: nil) = super

Instance Attribute Details

#eventsObject (readonly)

Returns the value of attribute events

Returns:

  • (Object)

    the current value of events



27
28
29
# File 'app/services/shipping/tracking_resync.rb', line 27

def events
  @events
end

#skipped_reasonObject (readonly)

Returns the value of attribute skipped_reason

Returns:

  • (Object)

    the current value of skipped_reason



27
28
29
# File 'app/services/shipping/tracking_resync.rb', line 27

def skipped_reason
  @skipped_reason
end

#webhook_logObject (readonly)

Returns the value of attribute webhook_log

Returns:

  • (Object)

    the current value of webhook_log



27
28
29
# File 'app/services/shipping/tracking_resync.rb', line 27

def webhook_log
  @webhook_log
end

Instance Method Details

#ingested?Boolean

Returns true when ShipEngine returned scans we ingested.

Returns:

  • (Boolean)

    true when ShipEngine returned scans we ingested



37
# File 'app/services/shipping/tracking_resync.rb', line 37

def ingested? = webhook_log.present?