Class: Wayfarer::Routing::PathFinder
- Inherits:
-
Object
- Object
- Wayfarer::Routing::PathFinder
- Defined in:
- lib/wayfarer/routing/path_finder.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(url) ⇒ PathFinder
constructor
A new instance of PathFinder.
- #visit(route) ⇒ Object
Constructor Details
#initialize(url) ⇒ PathFinder
Returns a new instance of PathFinder.
19 20 21 22 23 24 |
# File 'lib/wayfarer/routing/path_finder.rb', line 19 def initialize(url) @url = url @path = [] @action = nil @params = {} end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
14 15 16 |
# File 'lib/wayfarer/routing/path_finder.rb', line 14 def action @action end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
14 15 16 |
# File 'lib/wayfarer/routing/path_finder.rb', line 14 def params @params end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
14 15 16 |
# File 'lib/wayfarer/routing/path_finder.rb', line 14 def path @path end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
14 15 16 |
# File 'lib/wayfarer/routing/path_finder.rb', line 14 def url @url end |
Class Method Details
Instance Method Details
#visit(route) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/wayfarer/routing/path_finder.rb', line 26 def visit(route) return false if path.any? return false unless route.match(url) follow(route) if route.children.none? true end |