Class: NewStoreApi::Type11Enum
- Inherits:
-
Object
- Object
- NewStoreApi::Type11Enum
- Defined in:
- lib/new_store_api/models/type11_enum.rb
Overview
Type11.
Constant Summary collapse
- TYPE11_ENUM =
[ # TODO: Write general description for SHIPPING SHIPPING = 'shipping'.freeze, # TODO: Write general description for GIFTWRAPPING GIFTWRAPPING = 'gift-wrapping'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = SHIPPING) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/new_store_api/models/type11_enum.rb', line 23 def self.from_value(value, default_value = SHIPPING) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'shipping' then SHIPPING when 'giftwrapping' then GIFTWRAPPING else default_value end end |
.validate(value) ⇒ Object
17 18 19 20 21 |
# File 'lib/new_store_api/models/type11_enum.rb', line 17 def self.validate(value) return false if value.nil? TYPE11_ENUM.include?(value) end |