Sha256: 2b0e5c0a15f61f100286dfcb79a3e12e4e64b37eb424446de4d27fd4e7881bc6

Contents?: true

Size: 676 Bytes

Versions: 5

Compression:

Stored size: 676 Bytes

Contents

#encoding: utf-8

# the main module
module TheArrayComparator
  # the available strategies
  module SearchingStrategies
    #strategy contains
    class ContainsAny < Base
      
      # Create a new instance of strategy
      #
      # @see Base
      def initialize(sample=Sample.new)
        super

        warning_unsupported_exceptions
      end

      # Check the keywords with the data
      #
      # @return [Boolean]
      #   The result of the check
      def success?
        return true if @keywords.blank? and @data.blank?

        if ( @keywords & @data ).blank?
          return false
        else
          return true
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
the_array_comparator-0.5.0 lib/the_array_comparator/searching_strategies/contains_any.rb
the_array_comparator-0.4.0 lib/the_array_comparator/searching_strategies/contains_any.rb
the_array_comparator-0.3.4 lib/the_array_comparator/searching_strategies/contains_any.rb
the_array_comparator-0.3.1 lib/the_array_comparator/searching_strategies/contains_any.rb
the_array_comparator-0.3.0 lib/the_array_comparator/searching_strategies/contains_any.rb