Sha256: 5375c03cc90af242997ba10d7562375e2d14e459d77c3fafb79aa37c4d7d5fc5
Contents?: true
Size: 326 Bytes
Versions: 6
Compression:
Stored size: 326 Bytes
Contents
# frozen_string_literal: true module SimpleValidate class ValidatesPresenceOf < ValidatesBase def initialize(attribute, options) super(attribute, options[:message] || "can't be empty", options[:if] || proc { true }) end def valid?(instance) !instance.send(attribute).nil? end end end
Version data entries
6 entries across 6 versions & 1 rubygems