Class: Sitepress::RouteConstraint
- Inherits:
-
Object
- Object
- Sitepress::RouteConstraint
- Defined in:
- lib/sitepress/route_constraint.rb
Overview
Route constraint for rails routes.rb file.
Instance Attribute Summary collapse
-
#site ⇒ Object
readonly
Returns the value of attribute site.
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.
6 7 8 |
# File 'lib/sitepress/route_constraint.rb', line 6 def initialize(site: Sitepress.site) @site = site end |
Instance Attribute Details
#site ⇒ Object (readonly)
Returns the value of attribute site.
4 5 6 |
# File 'lib/sitepress/route_constraint.rb', line 4 def site @site end |
Instance Method Details
#matches?(request) ⇒ Boolean
10 11 12 |
# File 'lib/sitepress/route_constraint.rb', line 10 def matches?(request) !!site.resources.get(request.path) end |