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