Class: UspsApi::ProcessingCategory3

Inherits:
Object
  • Object
show all
Defined in:
lib/usps_api/models/processing_category3.rb

Overview

USPS categorizes parcels into one of two mail processing categories: MACHINABLE or NONSTANDARD. These categories are based on the physical dimensions of the piece, regardless of the placement (orientation) of the delivery address on the piece. For more information see [Domestic Mail Manual (DMM)](pe.usps.com/DMM300/201.htm). Machinable letter-size mail is: * Not less than 5 inches long, 3-1/2 inches high, and 0.007-inch thick. For pieces more than 4-1/4 inches high or 6 inches long, or both, the minimum thickness is 0.009.(Pieces not meeting the 0.009 thickness are non-machinable letters under 2.1.) * Not more than 11-1/2 inches long, or more than 6-1/8 inches high, or greater than 1/4-inch thick. * Rectangular, with four square corners and parallel opposite sides. Letter-size, card-type mailpieces made of cardstock may have finished corners that do not exceed a radius of 0.125 inch (1/8 inch) unless prepared as Customized Market Mail under 243.9.0. See Exhibit 1.1.1. * Within an aspect ratio (length divided by height) of 1.3 to 2.5, inclusive. * Subject to additional dimensional restrictions in 3.0, depending on mailpiece design. Flat-size mail must have the following characteristics: * Be more than 11-1/2 inches long, or more than 6-1/8 inches high, or more than 1/4 inch thick, other than automation flats under 6.0 or as allowed for USPS® Marketing Mail pieces with simplified addresses under 5.2.2. Mailpieces other than automation flats or USPS® Marketing Mail pieces with simplified addresses that are 1/4 inch thick or less must be at least 3-1/2 inches high and at least 5 inches long and be at least 0.007 inch thick. * Be not more than 15 inches long or more than 12 inches high or more than 3/4 inch thick, except for: * Periodicals non-machinable flat-size pieces mailed as specified in 207.26.0. They must not be more than 1–1/4 inches thick. * Polywrapped flats, with selvage that extends beyond the contents, up to a maximum length of 15-3/4 inches or a maximum height of 12-1/2 inches. The enclosed contents must not be longer than 15 inches or higher than 12 inches. * Co-mailed polywrapped flats mailed as specified in Customer Support Ruling PS-346, with selvage that extends beyond the contents, up to a maximum height of 12-7/8 inches. The enclosed contents must not be higher than 12 inches. * Be rectangular with four square corners or with finished corners that do not exceed a radius of 0.125 inch (1/8 inch) unless prepared as Customized Market Mail under 9.0. * Be categorized as a catalog. * Other size or weight standards may apply to mail addressed to certain APOs and FPOs, and mail sent by the Department of State to U.S. government personnel abroad. Note: * ‘IRREGULAR` is deprecated and will convert to `NONSTANDARD` as of 01/19/2025. * `NON_MACHINABLE` is deprecated and will convert to `NONSTANDARD` as of 01/19/2025.

Constant Summary collapse

PROCESSING_CATEGORY3 =
[
  # TODO: Write general description for LETTERS
  LETTERS = 'LETTERS'.freeze,

  # TODO: Write general description for FLATS
  FLATS = 'FLATS'.freeze,

  # TODO: Write general description for MACHINABLE
  MACHINABLE = 'MACHINABLE'.freeze,

  # TODO: Write general description for IRREGULAR
  IRREGULAR = 'IRREGULAR'.freeze,

  # TODO: Write general description for NON_MACHINABLE
  NON_MACHINABLE = 'NON_MACHINABLE'.freeze,

  # TODO: Write general description for NONSTANDARD
  NONSTANDARD = 'NONSTANDARD'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = LETTERS) ⇒ Object



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/usps_api/models/processing_category3.rb', line 73

def self.from_value(value, default_value = LETTERS)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'letters' then LETTERS
  when 'flats' then FLATS
  when 'machinable' then MACHINABLE
  when 'irregular' then IRREGULAR
  when 'non_machinable' then NON_MACHINABLE
  when 'nonstandard' then NONSTANDARD
  else
    default_value
  end
end

.validate(value) ⇒ Object



67
68
69
70
71
# File 'lib/usps_api/models/processing_category3.rb', line 67

def self.validate(value)
  return false if value.nil?

  PROCESSING_CATEGORY3.include?(value)
end