Sha256: 353418091a9fe45e64f7bbb0984032f08be15872ac71d27a8597835cedaa7ffe

Contents?: true

Size: 496 Bytes

Versions: 5

Compression:

Stored size: 496 Bytes

Contents

# frozen_string_literal: true

module Recollect::Array
  module Included
    def self.check!(item, iteratee, value)
      fetched_value = Array(Utility::TryFetchOrBlank[item, iteratee]).compact
      return false unless Array(fetched_value).count > 0

      fetched_value.any? do |expected_value|
        Array(value).include?(expected_value)
      end
    end
  end

  module NotIncluded
    def self.check!(item, iteratee, value)
      !Included.check!(item, iteratee, value)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
recollect-array-0.1.4 lib/recollect/array/predicate/in.rb
recollect-array-0.1.3 lib/recollect/array/predicate/in.rb
recollect-array-0.1.2 lib/recollect/array/predicate/in.rb
recollect-array-0.1.1 lib/recollect/array/predicate/in.rb
recollect-array-0.1.0 lib/recollect/array/predicate/in.rb