Class: ObjCursor
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from FromHash
#after_initialize, #from_hash, #initialize
Instance Attribute Details
Returns the value of attribute cursor.
2
3
4
|
# File 'lib/mongo_persist/mongo_ext.rb', line 2
def cursor
@cursor
end
|
Instance Method Details
12
13
14
|
# File 'lib/mongo_persist/mongo_ext.rb', line 12
def count
cursor.count
end
|
4
5
6
|
# File 'lib/mongo_persist/mongo_ext.rb', line 4
def each
cursor.each { |x| yield(x.to_mongo_object) }
end
|
7
8
9
10
11
|
# File 'lib/mongo_persist/mongo_ext.rb', line 7
def to_a
res = []
each { |x| res << x }
res
end
|