Unable to reach binding.pry

259 Views Asked by At

Trying to use binding.pry works until the emoticons_hash.each Trying to use it inside of .each or after it will not trigger it. It also doesn't work within other methods of this program, even with a puts "hello" after it.

require 'pry'
require 'yaml'
def load_library(filepath)
  emoticons_hash = YAML.load_file (filepath)
  puts emoticons_hash.inspect

  language_hash = {}
  emoticons_hash.each do |emoticon|
   language_hash[emoticon] = emoticons_hash[emoticon].value
   binding.pry
  end
  binding.pry
  puts "hello"
end

def english
     binding.pry
      puts "hello"
    end
1

There are 1 best solutions below

0
On

There's something in your emoticons_hash variable? If yes, it responds to .each method?

I think your binding.pry are not reaching this way because one of these two problems.