Class: WalmartApIs::Status3

Inherits:
Object
  • Object
show all
Defined in:
lib/walmart_ap_is/models/status3.rb

Overview

Status3.

Constant Summary collapse

STATUS3 =
[
  # TODO: Write general description for RESOLVED
  RESOLVED = 'Resolved'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = RESOLVED) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/walmart_ap_is/models/status3.rb', line 23

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

  str = value.to_s.strip

  case str.downcase
  when 'resolved' then RESOLVED
  when 'closed' then CLOSED
  else
    default_value
  end
end

.validate(value) ⇒ Object



17
18
19
20
21
# File 'lib/walmart_ap_is/models/status3.rb', line 17

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

  STATUS3.include?(value)
end