Sha256: eb7648a66789901a0e88d3b90881ef72c27c1b1d548aed46beb615ce459ab316

Contents?: true

Size: 738 Bytes

Versions: 1

Compression:

Stored size: 738 Bytes

Contents

module Apitizer
  module Routing
    module Node
      class Base
        def append(child)
          children << child
        end

        def trace(steps, path = Path.new)
          return nil unless recognize?(steps)

          steps, path = steps.clone, path.clone

          walk(steps, path)
          return path if steps.empty?

          children.each do |child|
            branch = child.trace(steps, path)
            return branch if branch
          end

          nil
        end

        def recognize?(steps)
        end

        def permit?(action, options)
        end

        private

        def walk(steps, path)
        end

        def children
          @children ||= []
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
apitizer-0.0.3 lib/apitizer/routing/node/base.rb