Sha256: 6eadb132cbf8446e25cd8b9be102939f1cf2d4a3f9f85e799e492a08464fbb4d
Contents?: true
Size: 758 Bytes
Versions: 3
Compression:
Stored size: 758 Bytes
Contents
# frozen_string_literal: true require_relative 'field_validator' module Dragnet module Validators module Fields # Validates the +description+ field for a MTR. class DescriptionValidator < Dragnet::Validators::Fields::FieldValidator # Validates a MTR's description # @param [String] key The name of the key # @param [Object] value The value of the key # @raise [Dragnet::Errors::ValidationError] If the description contains # anything but a +String+ or +nil+. # :reek:NilCheck (Only +nil+ is allowed, +false+ should be considered invalid). def validate(key, value) return if value.nil? validate_type(key, value, String) end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems