Method: PDK::Config::Validator.uuid

Defined in:
lib/pdk/config/validator.rb

.uuidHash{Symbol => [Proc,String]}

Returns a PDK::Config::Value validator that ensures that the value is a String that matches the regex for a version 4 UUID.

Returns:

  • (Hash{Symbol => [Proc,String]})

    a PDK::Config::Value validator that ensures that the value is a String that matches the regex for a version 4 UUID.



23
24
25
26
27
28
# File 'lib/pdk/config/validator.rb', line 23

def self.uuid
  {
    proc:    ->(value) { value.match(%r{\A\h{8}(?:-\h{4}){3}-\h{12}\z}) },
    message: _('must be a version 4 UUID'),
  }
end