Class: Rage::Router::ParametricNode

Inherits:
ParentNode show all
Defined in:
lib/rage/router/node.rb

Constant Summary

Constants inherited from Node

Node::PARAMETRIC, Node::STATIC, Node::WILDCARD

Instance Attribute Summary collapse

Attributes inherited from ParentNode

#static_children

Attributes inherited from Node

#handler_storage, #is_leaf_node, #kind

Instance Method Summary collapse

Methods inherited from ParentNode

#create_static_child, #find_static_matching_child

Methods inherited from Node

#add_route

Constructor Details

#initialize(static_suffix, node_path) ⇒ ParametricNode

Returns a new instance of ParametricNode.



179
180
181
182
183
184
185
# File 'lib/rage/router/node.rb', line 179

def initialize(static_suffix, node_path)
  super()
  @static_suffix = static_suffix
  @kind = Node::PARAMETRIC

  @node_paths = Set.new([node_path])
end

Instance Attribute Details

#node_pathsObject (readonly)

Returns the value of attribute node_paths.



177
178
179
# File 'lib/rage/router/node.rb', line 177

def node_paths
  @node_paths
end

#static_suffixObject (readonly)

Returns the value of attribute static_suffix.



177
178
179
# File 'lib/rage/router/node.rb', line 177

def static_suffix
  @static_suffix
end

Instance Method Details

#get_next_node(path, path_index, _, _) ⇒ Object



187
188
189
# File 'lib/rage/router/node.rb', line 187

def get_next_node(path, path_index, _, _)
  find_static_matching_child(path, path_index)
end