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-2.0.24-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.22-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.20-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.19-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.18-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.17-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.16-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.15-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.14-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.13-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.12-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.10-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.10.pre-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.8-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.6-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.4.pre-java lib/pacer/transform/has_count_cap.rb
pacer-2.0.0.pre-java lib/pacer/transform/has_count_cap.rb
pacer-1.6.0-java lib/pacer/transform/has_count_cap.rb
pacer-1.5.4-java lib/pacer/transform/has_count_cap.rb
pacer-1.5.3-java lib/pacer/transform/has_count_cap.rb