Sha256: b886729c94e0505122924813d5b7f19ba7c4e97bcc7e112a05c7804c777ec418

Contents?: true

Size: 349 Bytes

Versions: 20

Compression:

Stored size: 349 Bytes

Contents

module Shogun
  module Verifier
    class Uniqueness
      def initialize(data:, name:, list: [])
        @data = data
        @name = name
        @list = list || []
      end

      def valid?
        !@list.include?(@data)
      end

      def id
        "#{@name}_not_unique"
      end

      def context
        nil
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
shogun-6.4.2 lib/shogun/verifier/uniqueness.rb
shogun-6.4.1 lib/shogun/verifier/uniqueness.rb
shogun-6.4.0 lib/shogun/verifier/uniqueness.rb
shogun-6.3.0 lib/shogun/verifier/uniqueness.rb
shogun-6.2.3 lib/shogun/verifier/uniqueness.rb
shogun-6.2.2 lib/shogun/verifier/uniqueness.rb
shogun-6.2.1 lib/shogun/verifier/uniqueness.rb
shogun-6.2.0 lib/shogun/verifier/uniqueness.rb
shogun-6.1.0 lib/shogun/verifier/uniqueness.rb
shogun-6.0.0 lib/shogun/verifier/uniqueness.rb
shogun-4.0.1 lib/shogun/verifier/uniqueness.rb
shogun-4.0.0 lib/shogun/verifier/uniqueness.rb
shogun-3.4.0 lib/shogun/verifier/uniqueness.rb
shogun-3.2.0 lib/shogun/verifier/uniqueness.rb
shogun-3.1.0 lib/shogun/verifier/uniqueness.rb
shogun-3.0.0 lib/shogun/verifier/uniqueness.rb
shogun-2.1.1 lib/shogun/verifier/uniqueness.rb
shogun-2.1.0 lib/shogun/verifier/uniqueness.rb
shogun-2.0.0 lib/shogun/verifier/uniqueness.rb
shogun-1.0.0 lib/shogun/verifier/uniqueness.rb