Class: FriendlyShipping::Services::USPSShip::RateEstimatePackageOptions

Inherits:
PackageOptions
  • Object
show all
Defined in:
lib/friendly_shipping/services/usps_ship/rate_estimate_package_options.rb

Constant Summary collapse

PROCESSING_CATEGORIES =
{
  letters: "LETTERS",
  flats: "FLATS",
  machinable: "MACHINABLE",
  irregular: "IRREGULAR",
  non_machinable: "NON_MACHINABLE"
}.freeze
RATE_INDICATORS =
{
  three_digit: "3D",
  three_digit_dimensional_rectangular: "3N",
  three_digit_dimensional_nonrectangular: "3R",
  five_digit: "5D",
  basic: "BA",
  mixed_ndc: "BB",
  ndc: "BM",
  cubic_pricing_tier_1: "C1",
  cubic_pricing_tier_2: "C2",
  cubic_pricing_tier_3: "C3",
  cubic_pricing_tier_4: "C4",
  cubic_pricing_tier_5: "C5",
  cubic_parcel: "CP",
  usps_connect_local_mail: "CM",
  ndc_2: "DC",
  scf: "DE",
  five_digit_2: "DF",
  dimensional_nonrectangular: "DN",
  dimensional_rectangular: "DR",
  priority_mail_express_flat_rate_envelope_post_office_to_addressee: "E4",
  priority_mail_express_legal_flat_rate_envelope: "E6",
  priority_mail_express_legal_flat_rate_envelope_sunday_holiday: "E7",
  legal_flat_rate_envelope: "FA",
  medium_flat_rate_box_large_flat_rate_bag: "FB",
  flat_rate_envelope: "FE",
  padded_flat_rate_envelope: "FP",
  small_flat_rate_box: "FS",
  usps_connect_same_day_single_piece: "L1",
  usps_connect_same_day_small_flat_rate_bag: "L2",
  usps_connect_same_day_large_flat_rate_bag: "L3",
  usps_connect_same_day_flat_rate_box: "L4",
  usps_connect_same_day_oversized: "L5",
  usps_connect_local_single_piece: "LC",
  flat_rate_box: "LF",
  large_flat_rate_bag: "LL",
  usps_connect_local_oversized: "LO",
  small_flat_rate_bag: "LS",
  non_presorted: "NP",
  full_tray_box: "O1",
  half_tray_box: "O2",
  emm_tray_box: "O3",
  flat_tub_tray_box: "O4",
  surface_transported_pallet: "O5",
  full_pallet_box: "O6",
  half_pallet_box: "O7",
  oversized: "OS",
  cubic_soft_pack_tier_1: "P5",
  cubic_soft_pack_tier_2: "P6",
  cubic_soft_pack_tier_3: "P7",
  cubic_soft_pack_tier_4: "P8",
  cubic_soft_pack_tier_5: "P9",
  cubic_soft_pack_tier_6: "Q6",
  cubic_soft_pack_tier_7: "Q7",
  cubic_soft_pack_tier_8: "Q8",
  cubic_soft_pack_tier_9: "Q9",
  cubic_soft_pack_tier_10: "Q0",
  priority_mail_express_single_piece: "PA",
  large_flat_rate_box: "PL",
  large_flat_rate_box_apo_fpo_dpo: "PM",
  presorted: "PR",
  usps_connect_next_day_single_piece: "R1",
  usps_connect_next_day_dimensional_nonrectangular: "R2",
  usps_connect_next_day_dimensional_rectangular: "R3",
  usps_connect_next_day_oversized: "R4",
  small_flat_rate_bag_2: "SB",
  scf_dimensional_nonrectangular: "SN",
  single_piece: "SP",
  scf_dimensional_rectangular: "SR"
}.freeze
PRICE_TYPES =
{
  retail: "RETAIL",
  commercial: "COMMERCIAL",
  contract: "CONTRACT"
}.freeze

Instance Attribute Summary collapse

Attributes inherited from PackageOptions

#package_id

Instance Method Summary collapse

Methods inherited from PackageOptions

#options_for_item

Constructor Details

#initialize(processing_category: :machinable, rate_indicator: :single_piece, price_type: :retail, **kwargs) ⇒ RateEstimatePackageOptions

Returns a new instance of RateEstimatePackageOptions.

Parameters:

  • processing_category (Symbol) (defaults to: :machinable)
  • rate_indicator (Symbol) (defaults to: :single_piece)
  • price_type (Symbol) (defaults to: :retail)

    one of PRICE_TYPES

  • kwargs (Hash)
  • [String] (Hash)

    a customizable set of options

  • [Array<ItemOptions>] (Hash)

    a customizable set of options

  • [Class] (Hash)

    a customizable set of options



108
109
110
111
112
113
114
115
116
117
118
# File 'lib/friendly_shipping/services/usps_ship/rate_estimate_package_options.rb', line 108

def initialize(
  processing_category: :machinable,
  rate_indicator: :single_piece,
  price_type: :retail,
  **kwargs
)
  @processing_category = PROCESSING_CATEGORIES.fetch(processing_category)
  @rate_indicator = RATE_INDICATORS.fetch(rate_indicator)
  @price_type = PRICE_TYPES.fetch(price_type)
  super(**kwargs)
end

Instance Attribute Details

#price_typeString (readonly)

Returns:

  • (String)


99
100
101
# File 'lib/friendly_shipping/services/usps_ship/rate_estimate_package_options.rb', line 99

def price_type
  @price_type
end

#processing_categoryString (readonly)

Returns:

  • (String)


93
94
95
# File 'lib/friendly_shipping/services/usps_ship/rate_estimate_package_options.rb', line 93

def processing_category
  @processing_category
end

#rate_indicatorString (readonly)

Returns:

  • (String)


96
97
98
# File 'lib/friendly_shipping/services/usps_ship/rate_estimate_package_options.rb', line 96

def rate_indicator
  @rate_indicator
end