Class: Angus::Router::Route
- Inherits:
-
Struct
- Object
- Struct
- Angus::Router::Route
- Defined in:
- lib/angus/router.rb
Instance Attribute Summary collapse
-
#method ⇒ Object
Returns the value of attribute method.
-
#path_pattern ⇒ Object
Returns the value of attribute path_pattern.
-
#proc ⇒ Object
Returns the value of attribute proc.
Instance Method Summary collapse
-
#match(path) ⇒ MatchData?
Matches the given path against #path_pattern.
-
#param_names ⇒ Array<String>
Returns the parameter names for this route.
-
#params? ⇒ Boolean
Returns the true if the current route contains defined params.
Instance Attribute Details
#method ⇒ Object
Returns the value of attribute method
30 31 32 |
# File 'lib/angus/router.rb', line 30 def method @method end |
#path_pattern ⇒ Object
Returns the value of attribute path_pattern
30 31 32 |
# File 'lib/angus/router.rb', line 30 def path_pattern @path_pattern end |
#proc ⇒ Object
Returns the value of attribute proc
30 31 32 |
# File 'lib/angus/router.rb', line 30 def proc @proc end |
Instance Method Details
#match(path) ⇒ MatchData?
Matches the given path against #path_pattern.
50 51 52 |
# File 'lib/angus/router.rb', line 50 def match(path) path_pattern.match(path) end |
#param_names ⇒ Array<String>
Returns the parameter names for this route.
35 36 37 |
# File 'lib/angus/router.rb', line 35 def param_names path_pattern.param_names end |
#params? ⇒ Boolean
Returns the true if the current route contains defined params.
42 43 44 |
# File 'lib/angus/router.rb', line 42 def params? param_names.any? end |