Class: Rage::Router::Node
- Inherits:
-
Object
- Object
- Rage::Router::Node
- Defined in:
- lib/rage/router/node.rb
Direct Known Subclasses
Constant Summary collapse
- STATIC =
0
- PARAMETRIC =
1
- WILDCARD =
2
Instance Attribute Summary collapse
-
#handler_storage ⇒ Object
readonly
Returns the value of attribute handler_storage.
-
#is_leaf_node ⇒ Object
readonly
Returns the value of attribute is_leaf_node.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
Instance Method Summary collapse
- #add_route(route, constrainer) ⇒ Object
-
#initialize ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize ⇒ Node
Returns a new instance of Node.
11 12 13 14 15 |
# File 'lib/rage/router/node.rb', line 11 def initialize @is_leaf_node = false @routes = nil @handler_storage = nil end |
Instance Attribute Details
#handler_storage ⇒ Object (readonly)
Returns the value of attribute handler_storage.
9 10 11 |
# File 'lib/rage/router/node.rb', line 9 def handler_storage @handler_storage end |
#is_leaf_node ⇒ Object (readonly)
Returns the value of attribute is_leaf_node.
9 10 11 |
# File 'lib/rage/router/node.rb', line 9 def is_leaf_node @is_leaf_node end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
9 10 11 |
# File 'lib/rage/router/node.rb', line 9 def kind @kind end |
Instance Method Details
#add_route(route, constrainer) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/rage/router/node.rb', line 17 def add_route(route, constrainer) @routes ||= [] @handler_storage ||= HandlerStorage.new @is_leaf_node = true @routes << route @handler_storage.add_handler(constrainer, route) end |