Class: UspsApi::DestinationEntryFacilityType4

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

Overview

destinationEntryFacilityType4.

Constant Summary collapse

DESTINATION_ENTRY_FACILITY_TYPE4 =
[
  # TODO: Write general description for NONE
  NONE = 'NONE'.freeze,

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

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

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = NONE) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/usps_api/models/destination_entry_facility_type4.rb', line 34

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

  str = value.to_s.strip

  case str.downcase
  when 'none' then NONE
  when 'destination_network_distribution_center' then DESTINATION_NETWORK_DISTRIBUTION_CENTER
  when 'destination_sectional_center_facility' then DESTINATION_SECTIONAL_CENTER_FACILITY
  when 'destination_delivery_unit' then DESTINATION_DELIVERY_UNIT
  when 'destination_service_hub' then DESTINATION_SERVICE_HUB
  else
    default_value
  end
end

.validate(value) ⇒ Object



28
29
30
31
32
# File 'lib/usps_api/models/destination_entry_facility_type4.rb', line 28

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

  DESTINATION_ENTRY_FACILITY_TYPE4.include?(value)
end