Class: UspsApi::ProcessingCategory21

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

Overview

  • LETTERS To be eligible for mailing at the price for

letters, a piece must be: * Rectangular * At least 3-1/2 inches high x 5 inches long x 0.007 inch thick. * No more than 6-1/8 inches high x 11-1/2 inches long x 1/4 inch thick. For additional information on letters, please refer to the [Postal Explorer](pe.usps.com/businessmail101?ViewName=Letters). * FLATS The Postal Service uses the word “flats” to refer to large envelopes, newsletters, and magazines. The words large envelopes and flats are used interchangeably. Whatever you call them, flats must: * Have one dimension that is greater than 6-1/8 inches high OR 11-½ inches long OR ¼inch thick. * Be no more than 12 inches high x 15 inches long x ¾ inch thick. For additional information on flats, please refer to the [Postal Explorer](pe.usps.com/businessmail101?ViewName=Flats). * CARDS To be eligible for mailing at the price for postcards, a piece must be: * Rectangular * At least 3-1/2 inches high x 5 inches long x 0.007 inch thick. * No more than 4-1/4 inches high x 6 inches long x 0.016 inch thick. For additional information on postcards, please refer to the [Postal Explorer](pe.usps.com/businessmail101?ViewName=Cards).

Constant Summary collapse

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

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = LETTERS) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/usps_api/models/processing_category21.rb', line 43

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 'cards' then CARDS
  else
    default_value
  end
end

.validate(value) ⇒ Object



37
38
39
40
41
# File 'lib/usps_api/models/processing_category21.rb', line 37

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

  PROCESSING_CATEGORY21.include?(value)
end