Class: WalmartApIs::ShippingSpeedCategory
- Inherits:
-
Object
- Object
- WalmartApIs::ShippingSpeedCategory
- Defined in:
- lib/walmart_ap_is/models/shipping_speed_category.rb
Overview
ShippingSpeedCategory.
Constant Summary collapse
- SHIPPING_SPEED_CATEGORY =
[ # TODO: Write general description for STANDARD STANDARD = 'Standard'.freeze, # TODO: Write general description for EXPEDITED EXPEDITED = 'Expedited'.freeze, # TODO: Write general description for PRIORITY PRIORITY = 'Priority'.freeze, # TODO: Write general description for SCHEDULEDDELIVERY SCHEDULEDDELIVERY = 'ScheduledDelivery'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = STANDARD) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/walmart_ap_is/models/shipping_speed_category.rb', line 29 def self.from_value(value, default_value = STANDARD) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'standard' then STANDARD when 'expedited' then EXPEDITED when 'priority' then PRIORITY when 'scheduleddelivery' then SCHEDULEDDELIVERY else default_value end end |
.validate(value) ⇒ Object
23 24 25 26 27 |
# File 'lib/walmart_ap_is/models/shipping_speed_category.rb', line 23 def self.validate(value) return false if value.nil? SHIPPING_SPEED_CATEGORY.include?(value) end |