Sha256: cbf0b8204b7ec4bbef913ac2b8ef2352115a650eb68a1e60fb6385e0eb0d06e2

Contents?: true

Size: 1.63 KB

Versions: 21

Compression:

Stored size: 1.63 KB

Contents

# frozen_string_literal: true

module FriendlyShipping
  module Services
    class Usps
      CONTAINERS = {
        variable: 'VARIABLE',
        rectangular: 'RECTANGULAR',
        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: 'PACKAGESERVICE'
      }.freeze

      SHIPPING_METHODS = [
        'First-Class',
        'First-Class Package Service',
        '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

21 entries across 21 versions & 1 rubygems

Version Path
friendly_shipping-0.5 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.14 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.13 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.12 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.11 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.10 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.9 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.8 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.7 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.6 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.5 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.4 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.3 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.2 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.1 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.4.0 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.3.4 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.3.3 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.3.0 lib/friendly_shipping/services/usps/shipping_methods.rb
friendly_shipping-0.2.6 lib/friendly_shipping/services/usps/shipping_methods.rb