onthebeach/daodalus

View on GitHub
lib/daodalus/dsl/aggregation/limit.rb

Summary

Maintainability
A
20 mins
Test Coverage
module Daodalus
  module DSL
    module Aggregation
      class Limit
        include Operator

        def initialize(dao, total, query=[])
          @dao = dao
          @total = total
          @query = query
        end

        def operator
          '$limit'
        end

        def to_mongo
          {operator => total}
        end

        private

        attr_reader :total, :query

      end
    end
  end
end