Class: Dragnet::Validators::Fields::DescriptionValidator

Inherits:
FieldValidator
  • Object
show all
Defined in:
lib/dragnet/validators/fields/description_validator.rb

Overview

Validates the description field for a MTR.

Instance Method Summary collapse

Instance Method Details

#validate(key, value) ⇒ Object

Validates a MTR's description :reek:NilCheck (Only nil is allowed, false should be considered invalid).

Parameters:

  • key (String)

    The name of the key

  • value (Object)

    The value of the key

Raises:



16
17
18
19
20
# File 'lib/dragnet/validators/fields/description_validator.rb', line 16

def validate(key, value)
  return if value.nil?

  validate_type(key, value, String)
end