Sha256: 6285f649d8a09e1fbe68b174bd8a1b8e1cecf463359de2a86f72f028daa493e4

Contents?: true

Size: 327 Bytes

Versions: 4

Compression:

Stored size: 327 Bytes

Contents

module Mongoid
  class FakeCriteria
    def initialize(documents)
      @documents = documents
    end

    def limit(quantity)
      Mongoid::FakeCriteria.new(@documents[0..quantity-1])
    end

    def raw
      @documents
    end

    def method_missing(*args, &block)
      @documents.send(*args, &block)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mongoid-sorted-relations-0.0.4 lib/mongoid/fake_criteria.rb
mongoid-sorted-relations-0.0.3 lib/mongoid/fake_criteria.rb
mongoid-sorted-relations-0.0.2 lib/mongoid/fake_criteria.rb
mongoid-sorted-relations-0.0.1 lib/mongoid/fake_criteria.rb