Class: Hanami::Router::Leaf
- Inherits:
-
Object
- Object
- Hanami::Router::Leaf
- Defined in:
- lib/hanami/router/leaf.rb
Overview
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
private
Trie Leaf.
-
#to ⇒ Object
readonly
private
Trie Leaf.
Instance Method Summary collapse
-
#initialize(route, to, constraints) ⇒ Leaf
constructor
private
A new instance of Leaf.
- #match(path) ⇒ Object private
Constructor Details
#initialize(route, to, constraints) ⇒ Leaf
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Leaf.
16 17 18 19 20 21 |
# File 'lib/hanami/router/leaf.rb', line 16 def initialize(route, to, constraints) @route = route @to = to @constraints = constraints @params = nil end |
Instance Attribute Details
#params ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Trie Leaf
12 13 14 |
# File 'lib/hanami/router/leaf.rb', line 12 def params @params end |
#to ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Trie Leaf
12 13 14 |
# File 'lib/hanami/router/leaf.rb', line 12 def to @to end |
Instance Method Details
#match(path) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 28 29 30 31 |
# File 'lib/hanami/router/leaf.rb', line 25 def match(path) match = matcher.match(path) @params = match.named_captures if match match end |