Sha256: 0f883b6504f80342b456435c1ca64b37e4c443aebcc8d17bb41821b704bf9d55
Contents?: true
Size: 729 Bytes
Versions: 20
Compression:
Stored size: 729 Bytes
Contents
# frozen_string_literal: true # # Copyright (c) 2020-present, Blue Marble Payroll, LLC # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # require_relative 'base' module Burner module Modeling class Validations # Check if a value is blank, if it is not blank then it is not valid. class Blank < Base acts_as_hashable BLANK_RE = /\A[[:space:]]*\z/.freeze def valid?(object, resolver) value = resolver.get(object, key).to_s value.empty? || BLANK_RE.match?(value) end private def default_message 'must be blank' end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems