Sha256: c736a016bfcc4606f105ea8a6653234b4e0431c33bb1ffb586b787b61e14f5be

Contents?: true

Size: 1007 Bytes

Versions: 5

Compression:

Stored size: 1007 Bytes

Contents

module Pacer
  module Routes
    module RouteOperations
      def section(section_name = nil, visitor_target = nil)
        chain_route visitor: :section, section_name: section_name, visitor_target: visitor_target
      end
    end
  end

  module Visitors
    module Section
      attr_accessor :section_name, :visitor_target

      def will_visit!
        @visitor_count = visitor_count + 1
      end

      def section_visitor
        section_visitors.pop
      end

      protected

      def visitor_count
        @visitor_count = 0 unless defined? @visitor_count
        @visitor_count
      end

      attr_reader :section_visitors

      def attach_pipe(end_pipe)
        pipe = end_pipe
        @section_visitors = (1..visitor_count).map do
          pipe = Pacer::Pipes::SimpleVisitorPipe.new Pacer::Wrappers::WrapperSelector.build(graph, element_type, extensions), graph
          pipe.setStarts end_pipe if end_pipe
          end_pipe = pipe
        end
        pipe
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pacer-1.3.4-java lib/pacer/visitors/section.rb
pacer-1.3.3-java lib/pacer/visitors/section.rb
pacer-1.3.2-java lib/pacer/visitors/section.rb
pacer-1.3.1-java lib/pacer/visitors/section.rb
pacer-1.2.0-java lib/pacer/visitors/section.rb