module FinAppsCore::Utils::Validatable

Adds validation capabilities when included into other classes

Public Instance Methods

nil_or_empty?(value) click to toggle source
   # File lib/finapps_core/utils/validatable.rb
14 def nil_or_empty?(value)
15   !value || value.respond_to?(:empty?) && value.empty?
16 end
not_blank(value, name = nil) click to toggle source
   # File lib/finapps_core/utils/validatable.rb
10 def not_blank(value, name = nil)
11   fail FinAppsCore::MissingArgumentsError, name.nil? ? nil : ": #{name}" if nil_or_empty?(value)
12 end