Created
August 12, 2022 20:03
-
-
Save rbrooks/4dd10358ec47f2ec91b829231393fdd4 to your computer and use it in GitHub Desktop.
UUID is valid?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Uuid | |
class << self | |
def valid?(uuid: uuid) | |
uuid =~ /^[\d\w]{8}-[\d\w]{4}-[\d\w]{4}-[\d\w]{4}-[\d\w]{12}$/i | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment