Sha256: 4ba817c8caf9879e4aa742cb26619d243590d9414f80e59b9922c24dade65543

Contents?: true

Size: 570 Bytes

Versions: 24

Compression:

Stored size: 570 Bytes

Contents

# frozen_string_literal: true

module FriendlyShipping
  class Timing
    attr_reader :shipping_method,
                :pickup,
                :delivery,
                :guaranteed,
                :properties

    def initialize(
      shipping_method:,
      pickup:,
      delivery:,
      guaranteed: false,
      properties: {}
    )
      @shipping_method = shipping_method
      @pickup = pickup
      @delivery = delivery
      @guaranteed = guaranteed
      @properties = properties
    end

    def time_in_transit
      delivery - pickup
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
friendly_shipping-0.4.10 lib/friendly_shipping/timing.rb
friendly_shipping-0.4.9 lib/friendly_shipping/timing.rb
friendly_shipping-0.4.8 lib/friendly_shipping/timing.rb
friendly_shipping-0.4.7 lib/friendly_shipping/timing.rb