Sha256: 1cb48781e113aef050456b98f11fdd17f27f8ac46f518072b0843ddf3b7f6ca3

Contents?: true

Size: 1.64 KB

Versions: 5

Compression:

Stored size: 1.64 KB

Contents

# frozen_string_literal: true

module FriendlyShipping
  module Services
    class Usps
      CONTAINERS = {
        variable: 'VARIABLE',
        large_flat_rate_box: 'LG FLAT RATE BOX',
        medium_flat_rate_box: 'MD FLAT RATE BOX',
        small_flat_rate_box: 'SM FLAT RATE BOX',
        regional_rate_box_a: 'REGIONALRATEBOXA',
        regional_rate_box_b: 'REGIONALRATEBOXB',
        flat_rate_envelope: 'FLAT RATE ENVELOPE',
        legal_flat_rate_envelope: 'LEGAL FLAT RATE ENVELOPE',
        padded_flat_rate_envelope: 'PADDED FLAT RATE ENVELOPE',
        gift_card_flat_rate_envelope: 'GIFT CARD FLAT RATE ENVELOPE',
        window_flat_rate_envelope: 'WINDOW FLAT RATE ENVELOPE',
        small_flat_rate_envelope: 'SM FLAT RATE ENVELOPE',
        cubic_soft_pack: 'CUBIC SOFT PACK',
        cubic_parcels: 'CUBIC PARCELS'
      }.freeze

      FIRST_CLASS_MAIL_TYPES = {
        letter: 'LETTER',
        flat: 'FLAT',
        parcel: 'PARCEL',
        post_card: 'POSTCARD',
        package_service: 'PACKAGE SERVICE',
        package_service_retail: 'PACKAGE SERVICE RETAIL'
      }.freeze

      SHIPPING_METHODS = [
        'First-Class',
        'Package Services',
        'Priority',
        'Priority Mail Express',
        'Standard Post',
        'Retail Ground',
        'Media Mail',
        'Library Mail',
      ].map do |shipping_method_name|
        FriendlyShipping::ShippingMethod.new(
          origin_countries: [Carmen::Country.coded('US')],
          name: shipping_method_name,
          service_code: shipping_method_name.tr('-', ' ').upcase,
          domestic: true,
          international: false
        )
      end.freeze
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
friendly_shipping-0.6.2 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.6.1 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.6.0 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.5.3 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.5.2 lib/friendly_shipping/services/usps/shipping_methods.rb