mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
56fee39c39
Move the Journey code underneath the ActionDispatch namespace so that we don't pollute the global namespace with names that may be used for models. Fixes rails/journey#49.
24 lines
539 B
Ruby
24 lines
539 B
Ruby
module ActionDispatch
|
|
module Journey
|
|
class Router
|
|
class Strexp
|
|
class << self
|
|
alias :compile :new
|
|
end
|
|
|
|
attr_reader :path, :requirements, :separators, :anchor
|
|
|
|
def initialize path, requirements, separators, anchor = true
|
|
@path = path
|
|
@requirements = requirements
|
|
@separators = separators
|
|
@anchor = anchor
|
|
end
|
|
|
|
def names
|
|
@path.scan(/:\w+/).map { |s| s.tr(':', '') }
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|