Sha256: e048285daca3f24ada5855d67147308998d2f17add1dcc0b29c5aea98ff17991

Contents?: true

Size: 794 Bytes

Versions: 33

Compression:

Stored size: 794 Bytes

Contents

module Pacer
  module Routes
    module RouteOperations
      def make_pairs(other = nil, &block)
        if block
          # This would be cool if it could create a pair based on
          fail 'not implemented yet'
        elsif other
          if other.is_a? Route and [element_type, other.element_type].all? { |t| [:vertex, :edge].include? t }
            et = :path
          else
            et = :object
          end
          other = other.to_a
          if other.empty?
            empty(self)
          else
            flat_map(element_type: et, route_name: 'make_pairs') do |el|
              other.map { |o| [el, o] }
            end
          end
        else
          fail Pacer::ClientError, 'No source for pairs given to make_pairs'
        end
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
pacer-2.0.24-java lib/pacer/transform/make_pairs.rb
pacer-2.0.22-java lib/pacer/transform/make_pairs.rb
pacer-2.0.20-java lib/pacer/transform/make_pairs.rb
pacer-2.0.19-java lib/pacer/transform/make_pairs.rb
pacer-2.0.18-java lib/pacer/transform/make_pairs.rb
pacer-2.0.17-java lib/pacer/transform/make_pairs.rb
pacer-2.0.16-java lib/pacer/transform/make_pairs.rb
pacer-2.0.15-java lib/pacer/transform/make_pairs.rb
pacer-2.0.14-java lib/pacer/transform/make_pairs.rb
pacer-2.0.13-java lib/pacer/transform/make_pairs.rb
pacer-2.0.12-java lib/pacer/transform/make_pairs.rb
pacer-2.0.10-java lib/pacer/transform/make_pairs.rb
pacer-2.0.10.pre-java lib/pacer/transform/make_pairs.rb
pacer-2.0.8-java lib/pacer/transform/make_pairs.rb
pacer-2.0.6-java lib/pacer/transform/make_pairs.rb
pacer-2.0.4.pre-java lib/pacer/transform/make_pairs.rb
pacer-2.0.0.pre-java lib/pacer/transform/make_pairs.rb
pacer-1.6.0-java lib/pacer/transform/make_pairs.rb
pacer-1.5.4-java lib/pacer/transform/make_pairs.rb
pacer-1.5.3-java lib/pacer/transform/make_pairs.rb