kachick/ruby-ulid

Provide `ULID#patterns` instead of `ULID#pattern` and `ULID#strict_pattern`

kachick opened this issue · 0 comments

I applied ULID#pattern and ULID#strict_pattern in #35.

But related Regexp might be many patterns.

  • To cover #78 and #57
  • Compatible with other tools (e.g. Visual Studio Code)
  • And might be updated in future...

So providing it as collection as a Hash might be better, I think 🤔

Then considering cache strategy for them. Keeping Hash in all instance and compiles Regexp in freezing sounds needless and heavy.... They simply returns new Hash[Symbol, Regexp] when called the methods looks reasonable.