Class: Contracts::Stringy::UUID
- Inherits:
-
Object
- Object
- Contracts::Stringy::UUID
- Defined in:
- lib/contracts/stringy.rb
Overview
A string that looks like a UUID
Class Method Summary collapse
Class Method Details
.generate(*_args) ⇒ Object
69 70 71 |
# File 'lib/contracts/stringy.rb', line 69 def self.generate(*_args) SecureRandom.uuid end |
.valid?(value) ⇒ Boolean
65 66 67 |
# File 'lib/contracts/stringy.rb', line 65 def self.valid?(value) value.is_a? String and (value =~ UUID_REGEX) != nil end |