def find_hash_parents(toc, title)
      parents = ''
      toc.each_key do |key|
        next if toc[key].nil?
        toc[key].each do |item|
          if item.is_a?(Hash)
            if item.keys.include?(title)
              parents = key
              break
            else
              if item[item.keys.first].include?(title)
                parents = key
                break
              end
            end
          elsif title == item
            parents = key
            break
          end
        end
        break unless parents.empty?
      end
      parents
    end
def find_hash_parents(toc, title)
      parents = ''
      toc.each_key do |key|
        next if toc[key].nil?
        toc[key].each do |item|
          if item.is_a?(Hash)
            if item.keys.include?(title)
              parents = key
              break
            else
              if item[item.keys.first].include?(title)
                parents = key
                break
              end
            end
          elsif title == item
            parents = key
            break
          end
        end
        break unless parents.empty?
      end
      parents
    end
Given a category file that's a hash, this method finds
 the parent of an item