Class: MongoScope::ScopedCursor

Inherits:
Object
  • Object
show all
Includes:
FromHash
Defined in:
lib/mongo_scope.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from FromHash

#from_hash, #initialize

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym, *args, &b) ⇒ Object



53
54
55
# File 'lib/mongo_scope.rb', line 53

def method_missing(sym,*args,&b)
  cursor.send(sym,*args,&b)
end

Instance Attribute Details

#cursorObject

Returns the value of attribute cursor.



46
47
48
# File 'lib/mongo_scope.rb', line 46

def cursor
  @cursor
end

Instance Method Details

#each(&b) ⇒ Object



48
49
50
51
52
# File 'lib/mongo_scope.rb', line 48

def each(&b)
  cursor.each do |x|
    yield(MongoRow.new(x))
  end
end