Class: UspsApi::DpvDeliveryType
- Inherits:
-
Object
- Object
- UspsApi::DpvDeliveryType
- Defined in:
- lib/usps_api/models/dpv_delivery_type.rb
Overview
Indicates the delivery type. * ‘1` - The address has curb delivery. * `2` - The address has NDCBU delivery. * `3` - The address has central box delivery. * `4` - The address has other delivery.
Constant Summary collapse
- DPV_DELIVERY_TYPE =
[ # TODO: Write general description for ENUM_1 ENUM_1 = '1'.freeze, # TODO: Write general description for ENUM_2 ENUM_2 = '2'.freeze, # TODO: Write general description for ENUM_3 ENUM_3 = '3'.freeze, # TODO: Write general description for ENUM_4 ENUM_4 = '4'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = ENUM_1) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/usps_api/models/dpv_delivery_type.rb', line 31 def self.from_value(value, default_value = ENUM_1) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'enum_1' then ENUM_1 when 'enum_2' then ENUM_2 when 'enum_3' then ENUM_3 when 'enum_4' then ENUM_4 else default_value end end |
.validate(value) ⇒ Object
25 26 27 28 29 |
# File 'lib/usps_api/models/dpv_delivery_type.rb', line 25 def self.validate(value) return false if value.nil? DPV_DELIVERY_TYPE.include?(value) end |