I'm looking for a way to qualify if a filename ends with a suffix inside an array. 

```
filetypes = %w(.flac .wv)
Dir.open(Dir.pwd).each do |filename|
  q = "." + filename.split('.').last.to_s
  pp filename if filetypes.include?(q)
end

```

I'm thinking there has to be some kind of built-in iterator that traverses the qualifier array. Am I missing something here?

```
filetypes = %w(.flac .wv)
Dir.open(Dir.pwd).each do |filename|
  pp filename if filename.end_with?(filetypes)
end

```

This doesn't work. The docs say this: 

`end_with?([suffixes]+) → true or false`

So it suggests an array can be traversed, but it's not working for me. How can I pass an array to `end_with?`?