Sha256: 01e33278c3eef1deb4772c5aaf7bbea082f85baadaecb4153cf85a0f7a427c3d
Contents?: true
Size: 600 Bytes
Versions: 41
Compression:
Stored size: 600 Bytes
Contents
# frozen_string_literal: true require_relative 'required' class MiniDefender::Rules::RequiredWithAll < MiniDefender::Rules::Required def initialize(targets) unless targets.is_a?(Array) && targets.all?{ |t| t.is_a?(String) } raise ArgumentError, 'Expected an array of strings.' end @targets = targets end def self.signature 'required_with_all' end def self.make(args) raise ArgumentError, 'Expected at least one argument.' unless args.length >= 1 self.new(args) end def implicit?(validator) @targets.all? { |t| validator.data.key?(t) } end end
Version data entries
41 entries across 41 versions & 1 rubygems