lib/usher/route.rb in joshbuddy-usher-0.4.8 vs lib/usher/route.rb in joshbuddy-usher-0.4.10
- old
+ new
@@ -2,21 +2,20 @@
require File.join(File.dirname(__FILE__), 'route', 'variable')
require File.join(File.dirname(__FILE__), 'route', 'request_method')
class Usher
class Route
- attr_reader :paths, :original_path, :requirements, :conditions, :destination, :named, :generate_with
+ attr_reader :paths, :requirements, :conditions, :destination, :named, :generate_with
GenerateWith = Struct.new(:scheme, :port, :host)
- def initialize(original_path, router, conditions, requirements, default_values, generate_with) # :nodoc:
- @original_path = original_path
+ def initialize(parsed_paths, router, conditions, requirements, default_values, generate_with) # :nodoc:
@router = router
@requirements = requirements
@conditions = conditions
@default_values = default_values
- @paths = @router.splitter.split(@original_path, @requirements, @default_values).collect {|path| Path.new(self, path)}
@generate_with = GenerateWith.new(generate_with[:scheme], generate_with[:port], generate_with[:host]) if generate_with
+ @paths = parsed_paths.collect {|path| Path.new(self, path)}
end
def grapher
unless @grapher
@grapher = Grapher.new