Module: CaseGen::ComboMatcher

Included in:
ExcludeRule, ExpectRule
Defined in:
lib/case_gen/combo_matcher.rb

Instance Method Summary collapse

Instance Method Details

#ignore_keysObject



11
12
13
# File 'lib/case_gen/combo_matcher.rb', line 11

def ignore_keys
  %i[description reason note index]
end

#matches_criteria(combo, additional_ignore_keys = []) ⇒ Object



5
6
7
8
9
# File 'lib/case_gen/combo_matcher.rb', line 5

def matches_criteria(combo, additional_ignore_keys = [])
  criteria_keys = (@rule_data.keys - additional_ignore_keys) - ignore_keys
  criteria = @rule_data.slice(*criteria_keys)
  criteria == combo.hash_row.slice(*criteria_keys)
end