Sha256: d31721ad0c8428e0af8e4c154dbf9cfc5fbba847c5d8931f4809bee7c0eb277d
Contents?: true
Size: 239 Bytes
Versions: 2
Compression:
Stored size: 239 Bytes
Contents
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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
simple_validate-1.2.2 | lib/simple_validate/validates_inclusion_of.rb |
simple_validate-1.1.2 | lib/simple_validate/validates_inclusion_of.rb |