def enum(name, values = nil, **kwargs)
      values ||= kwargs[:in] || kwargs
      options = retrieve_options(kwargs)

      ensure_hash(values).tap do |mapping|
        define_attribute(name, mapping, options)
        define_reader(name, mapping)
        define_writer(name, mapping, options[:raise_on_invalid_values])
        define_method("#{name}_value") { attributes[name.to_s] }
        define_map_readers(name, mapping)
        define_predicate_methods(name, mapping, options)
      end
    end
Defines new enum

@param name [String] name of the enum to define
@param values [Object]
@param kwargs [Object]