mongodb/mongo-ruby-driver — pull request #422 by estolfo (2014-05-23 18:32:12+00:00)
Title: Fluent API base classes

I've taken a stab at implementing the fluent API.

There is one base class, CollectionView, that has all the methods to change and set options. CollectionView includes the Enumerable module and implements #each so that results can be iterated over.

There are four modules included in the CollectionView class and that implement different subcategories of the fluent API.

Modifyable:
- all methods using FindAndModify
- all return a single document
- all raise an error if skip is specified

Writable
- all methods using update or remove operations
- all raise an error if skip or sort is specified

Validatable
- methods for checking documents for being updates or replacements

Queryable
- methods involving doing a query