Class: AmzSpApi::ServicesApiModel::DayOfWeek

Inherits:
Object
  • Object
show all
Defined in:
lib/services-api-model/models/day_of_week.rb

Constant Summary collapse

MONDAY =
'MONDAY'.freeze
TUESDAY =
'TUESDAY'.freeze
WEDNESDAY =
'WEDNESDAY'.freeze
THURSDAY =
'THURSDAY'.freeze
FRIDAY =
'FRIDAY'.freeze
SATURDAY =
'SATURDAY'.freeze
SUNDAY =
'SUNDAY'.freeze

Instance Method Summary collapse

Instance Method Details

#build_from_hash(value) ⇒ String

Builds the enum from string

Parameters:

  • The (String)

    enum value in the form of the string

Returns:

  • (String)

    The enum value



27
28
29
30
31
# File 'lib/services-api-model/models/day_of_week.rb', line 27

def build_from_hash(value)
  constantValues = DayOfWeek.constants.select { |c| DayOfWeek::const_get(c) == value }
  raise "Invalid ENUM value #{value} for class #DayOfWeek" if constantValues.empty?
  value
end