Class: RubyRoutesTrie::Node
- Inherits:
-
Object
- Object
- RubyRoutesTrie::Node
- Defined in:
- lib/trie/node.rb
Constant Summary collapse
- DYNAMIC =
1- STATIC =
0
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#method ⇒ Object
Returns the value of attribute method.
-
#route ⇒ Object
Returns the value of attribute route.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #dynamic? ⇒ Boolean
-
#initialize(value) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(value) ⇒ Node
Returns a new instance of Node.
10 11 12 13 14 15 16 |
# File 'lib/trie/node.rb', line 10 def initialize(value) @children = [] @value = value @method = '' @route = '' @type = value[0] == ':' ? DYNAMIC : STATIC end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
6 7 8 |
# File 'lib/trie/node.rb', line 6 def children @children end |
#method ⇒ Object
Returns the value of attribute method.
8 9 10 |
# File 'lib/trie/node.rb', line 8 def method @method end |
#route ⇒ Object
Returns the value of attribute route.
8 9 10 |
# File 'lib/trie/node.rb', line 8 def route @route end |
#type ⇒ Object
Returns the value of attribute type.
8 9 10 |
# File 'lib/trie/node.rb', line 8 def type @type end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/trie/node.rb', line 6 def value @value end |
Instance Method Details
#dynamic? ⇒ Boolean
18 19 20 |
# File 'lib/trie/node.rb', line 18 def dynamic? @type == DYNAMIC end |