Sha256: 19bf83940be5ce04aee0c4fce8fc97078a1c52187608d1bb037fb2788e247b05
Contents?: true
Size: 1.12 KB
Versions: 14
Compression:
Stored size: 1.12 KB
Contents
module Pacer::Core::Graph::ElementRoute def payload(&block) chain_route transform: :payload, block: block end end module Pacer::Transform module Payload attr_accessor :block protected def attach_pipe(end_pipe) pipe = PayloadPipe.new(self, block) pipe.setStarts end_pipe if end_pipe pipe end class PayloadPipe < Pacer::Pipes::RubyPipe field_reader :currentEnd attr_reader :block, :wrapper def initialize(route, block) super() if route.element_type == :edge @wrapper = Pacer::Payload::Edge elsif route.element_type == :vertex @wrapper = Pacer::Payload::Vertex else fail Pacer::ClientError, 'Can not use PayloadPipe on non-element data' end block ||= proc { |el| nil } @block = Pacer::Wrappers::WrappingPipeFunction.new route, block end def processNextStart el = starts.next @wrapper.new el, block.call(el) end def getPathToHere path = super path.remove path.size - 1 path.add currentEnd path end end end end
Version data entries
14 entries across 14 versions & 1 rubygems