module Rethinker::Selection::Enumerable

Public Instance Methods

each() { |new_from_db| ... } click to toggle source
# File lib/rethinker/selection/enumerable.rb, line 2
def each(&block)
  return enum_for(:each) unless block

  klass.ensure_table! # needed as soon as we get a Query_Result
  run.each do |attrs|
    yield klass.new_from_db(attrs)
  end
  self
end
method_missing(name, *args, &block) click to toggle source

TODO Make something a bit more efficent ?

Calls superclass method
# File lib/rethinker/selection/enumerable.rb, line 18
def method_missing(name, *args, &block)
  return super unless [].respond_to?(name)
  each.__send__(name, *args, &block)
end
respond_to?(name, include_private = false) click to toggle source

TODO test that

Calls superclass method
# File lib/rethinker/selection/enumerable.rb, line 13
def respond_to?(name, include_private = false)
  super || [].respond_to?(name)
end