Sha256: 846c33af72507234215f85a44121a2a775836ede87becfd8dc2a6e177d8121d2
Contents?: true
Size: 1.2 KB
Versions: 32
Compression:
Stored size: 1.2 KB
Contents
module Pacer module Routes::RouteOperations def aggregate(into = nil, &block) aggregate = ::Pacer::SideEffect::Aggregate r = self r = section(into, aggregate::ElementSet) if into.is_a? Symbol into = block if block r.chain_route :side_effect => aggregate, :into => into end end module SideEffect module Aggregate import com.tinkerpop.pipes.sideeffect.AggregatePipe import java.util.HashSet include Pacer::Visitors::VisitsSection attr_reader :into def into=(name) @into = name self.section = name if name.is_a? Symbol end protected def attach_pipe(end_pipe) case into when Symbol hs = vars[into] = HashSet.new pipe = AggregatePipe.new hs when Proc pipe = AggregatePipe.new into.call(self) when nil pipe = AggregatePipe.new HashSet.new else pipe = AggregatePipe.new into end pipe.setStarts end_pipe if end_pipe pipe end class ElementSet < HashSet def on_element(element) add element end def reset clear end end end end end
Version data entries
32 entries across 32 versions & 1 rubygems