Class: Wallaby::ResourcesRegexp
- Inherits:
-
Object
- Object
- Wallaby::ResourcesRegexp
- Defined in:
- lib/routes/wallaby/resources_regexp.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#execute ⇒ Object
This method works with Map.id_regexp to complete the constraint restriction in ‘config/routes.rb`.
Instance Method Details
#execute ⇒ Object
This method works with Map.id_regexp to complete the constraint restriction in ‘config/routes.rb`. This regular expression matches all the possible resources names that are loaded from the mode_map
It looks like ‘(products|orders|order/items|…)`
9 10 11 12 13 |
# File 'lib/routes/wallaby/resources_regexp.rb', line 9 def execute Regexp.new(<<~REGEXP, Regexp::EXTENDED) (#{resources_sources.join('|')}) # all the possible resources names REGEXP end |