Class: Sitepress::RouteConstraint
- Inherits:
-
Object
- Object
- Sitepress::RouteConstraint
- Defined in:
- lib/sitepress/route_constraint.rb
Overview
Route constraint for rails routes.rb file.
Instance Method Summary collapse
-
#initialize(site: Sitepress.site) ⇒ RouteConstraint
constructor
A new instance of RouteConstraint.
- #matches?(request) ⇒ Boolean
Constructor Details
#initialize(site: Sitepress.site) ⇒ RouteConstraint
Returns a new instance of RouteConstraint.
4 5 6 |
# File 'lib/sitepress/route_constraint.rb', line 4 def initialize(site: Sitepress.site) @site = site end |
Instance Method Details
#matches?(request) ⇒ Boolean
8 9 10 |
# File 'lib/sitepress/route_constraint.rb', line 8 def matches?(request) !!@site.resources.get(request.path) end |