Sha256: e42fb935fc2dedfc1438c1908ebdb7406c08f9b77fb82dc97819ce0a5c4ac237

Contents?: true

Size: 512 Bytes

Versions: 6

Compression:

Stored size: 512 Bytes

Contents

require 'dynamoid/criteria/chain'

# encoding: utf-8
module Dynamoid #:nodoc:

  # This module defines criteria and criteria chains.
  module Criteria
    extend ActiveSupport::Concern
    
    module ClassMethods
      [:where, :all, :first, :each].each do |meth|
        define_method(meth) do |*args|
          chain = Dynamoid::Criteria::Chain.new(self)
          if args
            chain.send(meth, *args)
          else
            chain.send(meth)
          end
        end
      end
    end
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
dynamoid-0.1.2 lib/dynamoid/criteria.rb
dynamoid-0.1.1 lib/dynamoid/criteria.rb
dynamoid-0.1.0 lib/dynamoid/criteria.rb
dynamoid-0.0.7 lib/dynamoid/criteria.rb
dynamoid-0.0.6 lib/dynamoid/criteria.rb
dynamoid-0.0.5 lib/dynamoid/criteria.rb