title: How to get keys from hash ruby
body: <p>The next code search if keyword appear in hash values and print yes if so,
  but it works well in codeacademy console, but in my Rubymine it give me exception</p>
  
  <p>NoMethodError: undefined method `keys' for nil:NilClass</p>
  
  <p>I've tried to use each_key method but it was the same rusult.</p>
  
  <pre><code>arr = [
   { name: "2222", num:"4444 kod"},
   { name: "3222 kod", num:"43423444"},
   { name: "224422", num:"4442424"}
  ]
  
  p = "kod"
  
  arr.each do |frelancer|
  frelancer.keys.each do |key|
      if frelancer[key].split(" ").include? (p)
          puts "yes"
      esle 
    puts "no"
      end
  </code></pre>
  
  <p>end</p>
  
  <p>Can you give some advice?) </p>