Class: UspsApi::SuiteLinkIndicator

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

Overview

Indicates if a match was found from SuiteLink. * ‘00` - SuiteLink no match.

  • ‘A` - SuiteLink match.

Constant Summary collapse

[
  # TODO: Write general description for ENUM_00
  ENUM_00 = '00'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ENUM_00) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/usps_api/models/suite_link_indicator.rb', line 24

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

  str = value.to_s.strip

  case str.downcase
  when 'enum_00' then ENUM_00
  when 'a' then A
  else
    default_value
  end
end

.validate(value) ⇒ Object



18
19
20
21
22
# File 'lib/usps_api/models/suite_link_indicator.rb', line 18

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

  SUITE_LINK_INDICATOR.include?(value)
end