尝试使用binding.pry
有效,直到emoticons_hash.each
尝试在内部.each
或之后使用它不会触发它。它也不适用于该程序的其他方法,即使puts "hello"
在它之后也是如此。
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