def zscan_each(key, *args, &block)
      data_type_check(key, ZSet)
      return [] unless data[key]

      return to_enum(:zscan_each, key, options) unless block_given?
      cursor = 0
      loop do
        cursor, values = zscan(key, cursor, options)
        values.each(&block)
        break if cursor == '0'
      end
    end
def zscan_each(key, *args, &block)
      data_type_check(key, ZSet)
      return [] unless data[key]

      return to_enum(:zscan_each, key, options) unless block_given?
      cursor = 0
      loop do
        cursor, values = zscan(key, cursor, options)
        values.each(&block)
        break if cursor == '0'
      end
    end
Originally from redis-rb