Do not use semicolons to terminate expressions
Use \ instead of + to concatenate those strings
Fix useless assignment to variable - filter_type
Use %w for array of words
Use fail instead of raise to signal exceptions
Hash#has_key? is deprecated in favor of Hash#key?
Use the new Ruby 1.9 hash syntax
Favor format over String#%