Hash#has_key? is deprecated in favor of Hash#key?
Use empty lines between defs
Remove extra blank line
Keep a blank line before and after private
Fix inconsistent indentation