Sha256: 90bc1d247e8b5fe5cac7f5d990fca60211c1a4f3b9a64397ef1e15d534a61f98
Contents?: true
Size: 327 Bytes
Versions: 5
Compression:
Stored size: 327 Bytes
Contents
class GraphQL::Schema::EachItemValidator def initialize(errors) @errors = errors end def validate(items, as:, must_be:) invalid_items = items.select {|k| !yield(k) } if invalid_items.any? @errors << "#{as} must be #{must_be}, but some aren't: #{invalid_items.map(&:to_s).join(", ")}" end end end
Version data entries
5 entries across 5 versions & 1 rubygems