Method: Candy::Collection#each

Defined in:
lib/candy/collection.rb

#eachObject

Makes our collection enumerable. This relies heavily on Mongo::Cursor methods – we only reimplement it so that the objects we return can be Candy objects.



89
90
91
92
93
# File 'lib/candy/collection.rb', line 89

def each
  while this = @_candy_cursor.next_document
    yield self.class._candy_piece.new(this)
  end
end