Sha256: 03da866b6b83cd82fcba5ce259e44fe053e90d241c851f4f57f4df3095a3d55d

Contents?: true

Size: 787 Bytes

Versions: 1

Compression:

Stored size: 787 Bytes

Contents

# frozen_string_literal: true

module Physical
  class Shipment
    attr_reader :id,
                :origin,
                :destination,
                :service_code,
                :pallets,
                :structures,
                :packages,
                :options

    def initialize(id: nil, origin: nil, destination: nil, service_code: nil, pallets: [], structures: [], packages: [], options: {})
      @id = id || SecureRandom.uuid
      @origin = origin
      @destination = destination
      @service_code = service_code
      @structures = structures
      @packages = packages
      @options = options

      return unless pallets.any?

      warn "[DEPRECATION] `pallets` is deprecated.  Please use `structures` instead."
      @pallets = pallets
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
physical-0.5.0 lib/physical/shipment.rb