Class: UspsApi::ProcessingCategory5
- Inherits:
-
Object
- Object
- UspsApi::ProcessingCategory5
- Defined in:
- lib/usps_api/models/processing_category5.rb
Overview
Value designates if shipment is ‘MACHINABLE`, `NONSTANDARD, or `FLATS`. Note: * `NON_MACHINABLE` is deprecated and will convert to `NONSTANDARD` as of 01/19/2025.
Constant Summary collapse
- PROCESSING_CATEGORY5 =
[ # TODO: Write general description for FLATS FLATS = 'FLATS'.freeze, # TODO: Write general description for MACHINABLE MACHINABLE = 'MACHINABLE'.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 = FLATS) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/usps_api/models/processing_category5.rb', line 31 def self.from_value(value, default_value = FLATS) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'flats' then FLATS when 'machinable' then MACHINABLE when 'non_machinable' then NON_MACHINABLE when 'nonstandard' then NONSTANDARD else default_value end end |
.validate(value) ⇒ Object
25 26 27 28 29 |
# File 'lib/usps_api/models/processing_category5.rb', line 25 def self.validate(value) return false if value.nil? PROCESSING_CATEGORY5.include?(value) end |