mongodb/mongo-ruby-driver — pull request #433 by estolfo (2014-06-06 18:57:12+00:00)
Title: Refactor CollectionView and Cursor (Specs in progress)

After talking to @jyemin I realized that it would be better to only instantiate a cursor after it had actually been created on the server. I've refactored CollectionView and Cursor to let the CollectionView send the initial query and then "inflate" a cursor with the results and cursor id.
This separation allows us to:

- Keep the responsibility of the cursor to iteration, refreshing its cache, sending the kill cursor op.
- Let the CollectionView handle sending the initial query with the appropriate spec.
- Inflate multiple cursors with different result sets and cursor ids when doing something like a ParallelCollectionScan.
- Optionally return a cursor from an aggregation command / future commands

TODO:
Specs need to be refactored