lib/url_regexp/root.rb in url_regexp-0.1.2 vs lib/url_regexp/root.rb in url_regexp-0.1.3
- old
+ new
@@ -2,14 +2,15 @@
require_relative "./#{m}"
end
module UrlRegexp
class Root < Node
- def initialize
- @scheme = Scheme.new
- @host = Host.new
- @path = Path.new
- @query = Query.new
+ def initialize(options = {})
+ @scheme = Scheme.new(options)
+ @host = Host.new(options)
+ @path = Path.new(nil, nil, options)
+ @query = Query.new(options)
+ @options = options
end
def append(url)
url = URI(url) unless url.is_a?(URI)
@path.append(url.path)