uuid? predicate
zubin opened this issue · comments
Zubin Henner commented
UUIDs are widely used. Would you be open to adding a built-in predicate; something like this?
require 'uuidtools'
predicate(:uuid?) do |value|
UUIDTools::UUID.parse(value).valid?
rescue ArgumentError, TypeError
false
end
I'm happy to make a PR with tests if the idea is accepted.