def enum(valid_values, subschema = nil)
      subschema = inconvenience(subschema) if subschema
      Schemas::Enum.new(
        valid_values, subschema || type(valid_values.first.class),
      )
    end
def enum(valid_values, subschema = nil)
      subschema = inconvenience(subschema) if subschema
      Schemas::Enum.new(
        valid_values, subschema || type(valid_values.first.class),
      )
    end
Creates a {Schemas::Enum} schema

 @param valid_values [Array<Object>] An array of all possible valid values.
 @param subschema [schema] A schema that represents all enum members.
   If this is `nil`, the schema is inferred to be the type of the first
   element in `valid_values` (e.g. `enum([:a,:b,:c])` will have `_Symbol`
   as the inferred subschema).
 @return [Schemas::Enum]

 @example (see Schemas::Enum)