Sha256: 0f36392534cc483ed17c374b6975713a19b829e0c8a96aaddb319bd892f484dd

Contents?: true

Size: 864 Bytes

Versions: 37

Compression:

Stored size: 864 Bytes

Contents

module Pacer
  module Routes
    module RouteOperations
      def has_count_route(opts = {})
        chain_route({ :transform => :has_count_cap, element_type: :object }.merge(opts))
      end

      def has_count?(opts = {})
        has_count_route(opts).first
      end
    end
  end

  module Transform
    module HasCountCap
      import com.tinkerpop.pipes.transform.HasCountPipe

      attr_accessor :min, :max

      protected

      def attach_pipe(end_pipe)
        pipe = HasCountPipe.new(min || -1, max || -1)
        pipe.setStarts end_pipe if end_pipe
        pipe
      end

      def inspect_string
        if min and max
          "HasCount(#{ min }..#{max})"
        elsif min
          "HasCount(>= #{ min })"
        elsif max
          "HasCount(<= #{ max })"
        else
          "HasCount(...any...)"
        end
      end
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
pacer-1.5.2-java lib/pacer/transform/has_count_cap.rb
pacer-1.5.1-java lib/pacer/transform/has_count_cap.rb
pacer-1.4.2-java lib/pacer/transform/has_count_cap.rb
pacer-1.4.1-java lib/pacer/transform/has_count_cap.rb
pacer-1.4.0-java lib/pacer/transform/has_count_cap.rb
pacer-1.3.5-java lib/pacer/transform/has_count_cap.rb
pacer-1.3.4-java lib/pacer/transform/has_count_cap.rb
pacer-1.3.3-java lib/pacer/transform/has_count_cap.rb
pacer-1.3.2-java lib/pacer/transform/has_count_cap.rb
pacer-1.3.1-java lib/pacer/transform/has_count_cap.rb
pacer-1.2.0-java lib/pacer/transform/has_count_cap.rb
pacer-1.1.1-java lib/pacer/transform/has_count_cap.rb
pacer-1.1.0-java lib/pacer/transform/has_count_cap.rb
pacer-1.0.3-java lib/pacer/transform/has_count_cap.rb
pacer-1.0.2-java lib/pacer/transform/has_count_cap.rb
pacer-1.0.1-java lib/pacer/transform/has_count_cap.rb
pacer-1.0.0-java lib/pacer/transform/has_count_cap.rb