Class: Rack::App::Router::Tree
- Inherits:
-
Object
- Object
- Rack::App::Router::Tree
- Defined in:
- lib/rack/app/router/tree.rb
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Instance Method Summary collapse
- #add(endpoint) ⇒ Object
- #call(env) ⇒ Object
-
#initialize ⇒ Tree
constructor
A new instance of Tree.
Constructor Details
#initialize ⇒ Tree
Returns a new instance of Tree.
12 13 14 |
# File 'lib/rack/app/router/tree.rb', line 12 def initialize @root = self.class::Branch.new end |
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
10 11 12 |
# File 'lib/rack/app/router/tree.rb', line 10 def root @root end |
Instance Method Details
#add(endpoint) ⇒ Object
16 17 18 |
# File 'lib/rack/app/router/tree.rb', line 16 def add(endpoint) @root.set(self.class::Env.new(endpoint)) end |
#call(env) ⇒ Object
20 21 22 23 |
# File 'lib/rack/app/router/tree.rb', line 20 def call(env) configure_request(env) @root.call(env, *env[Rack::App::Constants::ENV::SPLITTED_PATH_INFO]) end |