Sha256: 2c2d12f84f4bab4f64f6c151c528854f740dc1f50105bcb8a8489d7d36f621e3
Contents?: true
Size: 271 Bytes
Versions: 5
Compression:
Stored size: 271 Bytes
Contents
# frozen_string_literal: true module SimpleValidate class ValidatesInclusionOf < ValidatesSetBase def valid?(instance) raise ArgumentError if set.empty? || !options.fetch(:in).is_a?(Array) set.include?(instance.send(attribute).to_s) end end end
Version data entries
5 entries across 5 versions & 1 rubygems