﻿using System.Collections.Generic;
using System.Text.RegularExpressions;

namespace CoreGlue.Middleware.LiquidMvc.Documents.Routes
{
    public class RouteDocument
    {
        public List<RouteNode> Routes { get; set; }

        public RouteMatch MatchRoute(string url)
        {
            foreach (RouteNode route in this.Routes)
            {
                var match = route.GetMatch(url);

                if (match != null)
                {
                    return match;
                }
            }

            return null;
        }
    }
}
