Class: Para::Routing::ComponentControllerConstraint
- Inherits:
-
Object
- Object
- Para::Routing::ComponentControllerConstraint
- Defined in:
- lib/para/routing/component_controller_constraint.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
Instance Method Summary collapse
-
#initialize(controller) ⇒ ComponentControllerConstraint
constructor
A new instance of ComponentControllerConstraint.
- #matches?(request) ⇒ Boolean
Constructor Details
#initialize(controller) ⇒ ComponentControllerConstraint
Returns a new instance of ComponentControllerConstraint.
13 14 15 |
# File 'lib/para/routing/component_controller_constraint.rb', line 13 def initialize(controller) @controller = controller.to_sym end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
11 12 13 |
# File 'lib/para/routing/component_controller_constraint.rb', line 11 def controller @controller end |
Instance Method Details
#matches?(request) ⇒ Boolean
17 18 19 20 21 |
# File 'lib/para/routing/component_controller_constraint.rb', line 17 def matches?(request) component = component_for(request.params[:component_id]) return false unless component && component.controller component.controller.to_sym == controller end |