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