Class: TheArrayComparator::SearchingStrategies::ContainsAll
- Defined in:
- lib/the_array_comparator/searching_strategies/contains_all.rb
Overview
strategy contains
Instance Method Summary collapse
-
#initialize(sample = Sample.new) ⇒ ContainsAll
constructor
Create a new instance of strategy.
-
#success? ⇒ Boolean
Check the keywords with the data.
Constructor Details
#initialize(sample = Sample.new) ⇒ ContainsAll
Create a new instance of strategy
13 14 15 16 17 |
# File 'lib/the_array_comparator/searching_strategies/contains_all.rb', line 13 def initialize(sample=Sample.new) super warning_unsupported_exceptions end |
Instance Method Details
#success? ⇒ Boolean
Check the keywords with the data
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/the_array_comparator/searching_strategies/contains_all.rb', line 23 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 |