class Mustermann::Router::Simple

Simple pattern based router that allows matching a string to a given callback.

@example

require 'mustermann/router/simple'

router = Mustermann::Router::Simple.new do
  on ':name/:sub' do |string, params|
    params['sub']
  end

  on 'foo' do
    "bar"
  end
end

router.call("foo") # => "bar"
router.call("a/b") # => "b"
router.call("bar") # => nil