Sha256: 326204ffff50770793d3aee90ad62e8c5ae684eb3dd38b35177319e5d728fd86

Contents?: true

Size: 441 Bytes

Versions: 2

Compression:

Stored size: 441 Bytes

Contents

module Ratlas
  module Queryable
    def self.included(base)
      base.extend(ClassMethods)

    end
    
    module ClassMethods
      
      def where(args)
        find(args)
      end
      
      def find(args)
        if args.is_a?(Symbol)
          Ratlas::Query.new(self, args)
        elsif args.is_a?(Hash)
          Ratlas::Query.new(self, :all, args)
        end
        
      end    
      
    end
    
  
    
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ratlas-0.1.2 lib/ratlas/queryable.rb
ratlas-0.1.1 lib/ratlas/queryable.rb