Class: WalmartApIs::DeliveryExperience
- Inherits:
-
Object
- Object
- WalmartApIs::DeliveryExperience
- Defined in:
- lib/walmart_ap_is/models/delivery_experience.rb
Overview
DeliveryExperience.
Constant Summary collapse
- DELIVERY_EXPERIENCE =
[ # TODO: Write general description for # DELIVERYCONFIRMATIONWITHADULTSIGNATURE DELIVERYCONFIRMATIONWITHADULTSIGNATURE = 'DeliveryConfirmationWithAdultSignature'.freeze, # TODO: Write general description for DELIVERYCONFIRMATIONWITHSIGNATURE DELIVERYCONFIRMATIONWITHSIGNATURE = 'DeliveryConfirmationWithSignature'.freeze, # TODO: Write general description for DELIVERYCONFIRMATIONWITHOUTSIGNATURE DELIVERYCONFIRMATIONWITHOUTSIGNATURE = 'DeliveryConfirmationWithoutSignature'.freeze, # TODO: Write general description for NOTRACKING NOTRACKING = 'NoTracking'.freeze ].freeze
Class Method Summary collapse
- .from_value(value, default_value = DELIVERYCONFIRMATIONWITHADULTSIGNATURE) ⇒ Object
- .validate(value) ⇒ Object
Class Method Details
.from_value(value, default_value = DELIVERYCONFIRMATIONWITHADULTSIGNATURE) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/walmart_ap_is/models/delivery_experience.rb', line 30 def self.from_value(value, default_value = DELIVERYCONFIRMATIONWITHADULTSIGNATURE) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'deliveryconfirmationwithadultsignature' then DELIVERYCONFIRMATIONWITHADULTSIGNATURE when 'deliveryconfirmationwithsignature' then DELIVERYCONFIRMATIONWITHSIGNATURE when 'deliveryconfirmationwithoutsignature' then DELIVERYCONFIRMATIONWITHOUTSIGNATURE when 'notracking' then NOTRACKING else default_value end end |
.validate(value) ⇒ Object
24 25 26 27 28 |
# File 'lib/walmart_ap_is/models/delivery_experience.rb', line 24 def self.validate(value) return false if value.nil? DELIVERY_EXPERIENCE.include?(value) end |