Sha256: 0152b5a2e4ef1128f6b18def6265bd4f4265746c144759f5b5580f6bd8f07348
Contents?: true
Size: 476 Bytes
Versions: 10
Compression:
Stored size: 476 Bytes
Contents
# frozen_string_literal: true using ObjectExtensions using StringExtensions module FinAppsCore module Utils # Adds validation capabilities when included into other classes module Validatable def not_blank(value, name = nil) fail FinAppsCore::MissingArgumentsError, name.nil? ? nil : ": #{name}" if nil_or_empty?(value) end def nil_or_empty?(value) !value || value.respond_to?(:empty?) && value.empty? end end end end
Version data entries
10 entries across 10 versions & 1 rubygems