Method: PDK::Config::Validator.boolean

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

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

Returns a PDK::Config::Value validator that ensures that the value is either a TrueClass or FalseClass.

Returns:

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

    a PDK::Config::Value validator that ensures that the value is either a TrueClass or FalseClass.



13
14
15
16
17
18
# File 'lib/pdk/config/validator.rb', line 13

def self.boolean
  {
    proc:    ->(value) { [true, false].include?(value) },
    message: _('must be a boolean: true or false'),
  }
end