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.



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

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.



175
176
177
# File 'lib/rage/router/node.rb', line 175

def node_paths
  @node_paths
end

#static_suffixObject (readonly)

Returns the value of attribute static_suffix.



175
176
177
# File 'lib/rage/router/node.rb', line 175

def static_suffix
  @static_suffix
end

Instance Method Details

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



185
186
187
# File 'lib/rage/router/node.rb', line 185

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