Sha256: 1d3eab4d04e4f68ed96942b070c4a994a869d20212aa34f1763681ca52a91e40

Contents?: true

Size: 690 Bytes

Versions: 15

Compression:

Stored size: 690 Bytes

Contents

module Predicates

  module Where
    class WherePredicate

      attr_reader :predicates

      def initialize
        @predicates = empty
      end

      def where(predicates)
        @predicates = predicates.is_a?(Pair::Pair) ? @predicates.append(predicates) : @predicates.join(Pair.from_map(predicates))
        self
      end

      def and(predicates)
        @predicates = predicates.is_a?(Pair::Pair) ? @predicates.append(predicates) : @predicates.join(Pair.from_map(predicates))
        self
      end

    end

    def where(predicate_map)
      WherePredicate.new.where(predicate_map)
    end

    def is(single_predicate)
      pair(:self, single_predicate)
    end

  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
totally_lazy-0.0.20 lib/predicates/where.rb
totally_lazy-0.0.19 lib/predicates/where.rb
totally_lazy-0.0.18 lib/predicates/where.rb
totally_lazy-0.0.16 lib/predicates/where.rb
totally_lazy-0.0.15 lib/predicates/where.rb
totally_lazy-0.0.14 lib/predicates/where.rb
totally_lazy-0.0.13 lib/predicates/where.rb
totally_lazy-0.0.12 lib/predicates/where.rb
totally_lazy-0.0.11 lib/predicates/where.rb
totally_lazy-0.0.10 lib/predicates/where.rb
totally_lazy-0.0.9 lib/predicates/where.rb
totally_lazy-0.0.8 lib/predicates/where.rb
totally_lazy-0.0.7 lib/predicates/where.rb
totally_lazy-0.0.6 lib/predicates/where.rb
totally_lazy-0.0.5 lib/predicates/where.rb