def has_set_coerce_argument_value(enum_class, argument_value)
      invalid_set_elements = []
      set_elements =
        if String === argument_value
          argument_value.split(',').map(&:strip)
        else
          Array(argument_value)
        end.map do |set_element|
          if result = enum_class[set_element]
            result
          else
            invalid_set_elements << set_element
            nil
          end
        end
      invalid_set_elements.empty? or
        raise ArgumentError, "element #{argument_value.inspect} contains invalid elements: #{invalid_set_elements.inspect}"
      set_elements
    end
def has_set_coerce_argument_value(enum_class, argument_value)
      invalid_set_elements = []
      set_elements =
        if String === argument_value
          argument_value.split(',').map(&:strip)
        else
          Array(argument_value)
        end.map do |set_element|
          if result = enum_class[set_element]
            result
          else
            invalid_set_elements << set_element
            nil
          end
        end
      invalid_set_elements.empty? or
        raise ArgumentError, "element #{argument_value.inspect} contains invalid elements: #{invalid_set_elements.inspect}"
      set_elements
    end
Understands the arguments as the list of enum values
  The argument value can be
    - a `string` of enum values joined by a comma
    - an enum constant
    - a `symbol` which resolves to the enum constant
    - an `integer` as the index of the enum class
  If you have just 1 value, you do not need to enclose it in an `Array`