Checking cell combination in a table

I'm trying to implement an algorithm for table verification, but I'm confused with the multiple choices Ruby supplies for working with arrays and hashes and I need help putting it all together. Consider this table as example:

My method should count the number of occurrences of a specific cell combination. For example:

match_line([A => 1, C => 3])

The results should be

2

, as this combination exists in both the first row and the last one.
What I did so far is to create an

hash

variable that hold column indexing like so:

[A => 0, B => 1, C=> 2]

And I also have an array list which holds all the above table rows like so:

[[1, 2, 3], [1, 2, 4], [5, 6, 7], [1, 1, 3]]

The logic looks like that - the

match_line

method above specific the user wants to match a row where column A has the

1

value in it and column C has the

3

value in it. Based on my index hash, the A column index is

0

and C index is

2

. Now for each array (row) in the array list, if index 0 equals

1

and index 2 equals

3

like the user requested , I add +1 to a counter and keep going over the other array row until I'm over.

I tried to form it into code, but I ended with a way that seems very not efficient of doing so, I'm interested to see your code example to see perhaps Ruby has inner Enumerable methods that I'm not aware of to make it more elegant.