class Apitizer::Routing::Node::Base

Public Instance Methods

append(child) click to toggle source
# File lib/apitizer/routing/node/base.rb, line 5
def append(child)
  children << child
end
permit?(action, options) click to toggle source
# File lib/apitizer/routing/node/base.rb, line 28
def permit?(action, options)
end
recognize?(steps) click to toggle source
# File lib/apitizer/routing/node/base.rb, line 25
def recognize?(steps)
end
trace(steps, path = Path.new) click to toggle source
# File lib/apitizer/routing/node/base.rb, line 9
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

Private Instance Methods

children() click to toggle source
# File lib/apitizer/routing/node/base.rb, line 36
def children
  @children ||= []
end
walk(steps, path) click to toggle source
# File lib/apitizer/routing/node/base.rb, line 33
def walk(steps, path)
end