module Crystal module Routes class Configurator def initialize router @router = router end def named_route *args, &block named_router = @router.routes[:named_router] raise "There's no NamedRouter (use config to add it)!" unless named_router named_router.add *args, &block end class << self inject :router => :router def routes &block block.call Configurator.new(router) end end end end end