Class: UspsApi::SubscriptionType3

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

Overview

The subscription type defines the data domain for this subscription.

Constant Summary collapse

SUBSCRIPTION_TYPE3 =
[
  # TODO: Write general description for UNPAID_PACKAGES
  UNPAID_PACKAGES = 'UNPAID_PACKAGES'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = UNPAID_PACKAGES) ⇒ Object



20
21
22
23
24
# File 'lib/usps_api/models/subscription_type3.rb', line 20

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

  default_value
end

.validate(value) ⇒ Object



14
15
16
17
18
# File 'lib/usps_api/models/subscription_type3.rb', line 14

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

  SUBSCRIPTION_TYPE3.include?(value)
end