Sha256: a7906357792a05925ee2342d64a1389ab8724f8bed39674a40601f3ebc0a79e1

Contents?: true

Size: 724 Bytes

Versions: 2

Compression:

Stored size: 724 Bytes

Contents

#encoding: utf-8

# the main module
module TheArrayComparator
  # the available strategies
  module Strategies
    #strategy contains
    class ContainsAll < 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?
        return false if @keywords.blank? or @data.blank?

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
the_array_comparator-0.2.0 lib/the_array_comparator/strategies/contains_all.rb
the_array_comparator-0.1.1 lib/the_array_comparator/strategies/contains_all.rb