Sha256: df3e1bfd72f0588bb407072dcf9a79e08e718a008d65a8fad45ee0c6ec500186
Contents?: true
Size: 494 Bytes
Versions: 20
Compression:
Stored size: 494 Bytes
Contents
module Shogun module Verifier class Allowed def initialize(name:, data:, list: []) @data = data @name = name @list = list || [] end def valid? @data.all?(&method(:allowed?)) end def id "#{@name}_not_allowed" end def context { "unallowed" => @data.reject(&method(:allowed?)) } end private def allowed?(item) @list.include?(item) end end end end
Version data entries
20 entries across 20 versions & 1 rubygems