Class: TheArrayComparator::SearchingStrategies::Base
- Inherits:
-
Object
- Object
- TheArrayComparator::SearchingStrategies::Base
- Defined in:
- lib/the_array_comparator/searching_strategies/base.rb
Overview
base class for strategies
Direct Known Subclasses
ContainsAll, ContainsAllWithSubstringSearch, ContainsAny, ContainsAnyWithSubstringSearch, ContainsNot, ContainsNotWithSubstringSearch, IsEqual, IsNotEqual
Instance Method Summary collapse
-
#initialize(sample = Sample.new) ⇒ Object
constructor
Create a new instance of strategy.
-
#success? ⇒ Boolean
Check the keywords with the data.
Constructor Details
#initialize(sample = Sample.new) ⇒ Object
Create a new instance of strategy
17 18 19 20 21 22 |
# File 'lib/the_array_comparator/searching_strategies/base.rb', line 17 def initialize(sample=Sample.new) @data = sample.data @keywords = sample.keywords @exceptions = sample.exceptions @tag = sample.tag end |
Instance Method Details
#success? ⇒ Boolean
Note:
needs to be implemented by the concrete strategy
Check the keywords with the data
30 31 32 |
# File 'lib/the_array_comparator/searching_strategies/base.rb', line 30 def success? raise Exceptions::IncompatibleComparator, "The chosen comparator is incompatible, Please check the documentation for comparator strategies on how to build a compatible one." end |