thetron/mongoid_token — Issue #7: Add support for tokens generated from patterns
Author: thetron
Created: 2012-02-08 01:34:55+00:00
State: open

Tokens should also be able to be generated from patterns. Something like:

````
class Person
include Mongoid::Document
include Mongoid::Token

field :name

token :pattern => /[0-9]{5}-[A-Za-z]{3}/
end
````

Consider using [randexp](https://github.com/benburkert/randexp) to support this.