Sha256: e8db5ea023981edbc4760cefc3e2ce81b3ff69a7e5055732d84d7c1efc7c9318
Contents?: true
Size: 561 Bytes
Versions: 2
Compression:
Stored size: 561 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) if nil_or_empty?(value) argument_name = name.nil? ? nil : ": #{name}" raise FinAppsCore::MissingArgumentsError.new "Missing argument#{argument_name}" end end def nil_or_empty?(value) !value || (value.respond_to?(:empty) && value.empty?) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
finapps_core-2.0.17 | lib/finapps_core/utils/validatable.rb |
finapps_core-2.0.16 | lib/finapps_core/utils/validatable.rb |