Class: TheArrayComparator::SearchingStrategies::ContainsAny
- Defined in:
- lib/the_array_comparator/searching_strategies/contains_any.rb
Overview
strategy contains
Instance Method Summary collapse
-
#initialize(sample = Sample.new) ⇒ ContainsAny
constructor
Create a new instance of strategy.
-
#success? ⇒ Boolean
Check the keywords with the data.
Constructor Details
#initialize(sample = Sample.new) ⇒ ContainsAny
Create a new instance of strategy
13 14 15 16 17 |
# File 'lib/the_array_comparator/searching_strategies/contains_any.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 |
# File 'lib/the_array_comparator/searching_strategies/contains_any.rb', line 23 def success? return true if @keywords.blank? and @data.blank? if ( @keywords & @data ).blank? return false else return true end end |