1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/lib/action_dispatch/journey/router/strexp.rb
2012-12-20 15:42:39 -05:00

24 lines
570 B
Ruby

module ActionDispatch
module Journey # :nodoc:
class Router # :nodoc:
class Strexp # :nodoc:
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