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.
13 14 15 16 17 |
# File 'lib/rage/router/node.rb', line 13 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.
11 12 13 |
# File 'lib/rage/router/node.rb', line 11 def handler_storage @handler_storage end |
#is_leaf_node ⇒ Object (readonly)
Returns the value of attribute is_leaf_node.
11 12 13 |
# File 'lib/rage/router/node.rb', line 11 def is_leaf_node @is_leaf_node end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
11 12 13 |
# File 'lib/rage/router/node.rb', line 11 def kind @kind end |
Instance Method Details
#add_route(route, constrainer) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/rage/router/node.rb', line 19 def add_route(route, constrainer) @routes ||= [] @handler_storage ||= HandlerStorage.new @is_leaf_node = true @routes << route @handler_storage.add_handler(constrainer, route) end |