Class: Rack::App::Router::Tree::Env
- Inherits:
-
Object
- Object
- Rack::App::Router::Tree::Env
- Defined in:
- lib/rack/app/router/tree/env.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#request_path_parts ⇒ Object
readonly
Returns the value of attribute request_path_parts.
Instance Method Summary collapse
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
4 5 6 |
# File 'lib/rack/app/router/tree/env.rb', line 4 def endpoint @endpoint end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'lib/rack/app/router/tree/env.rb', line 4 def params @params end |
#request_path_parts ⇒ Object (readonly)
Returns the value of attribute request_path_parts.
4 5 6 |
# File 'lib/rack/app/router/tree/env.rb', line 4 def request_path_parts @request_path_parts end |
Instance Method Details
#branch? ⇒ Boolean
10 11 12 |
# File 'lib/rack/app/router/tree/env.rb', line 10 def branch? !clean_request_path_parts[@index..-2].empty? end |
#current ⇒ Object
6 7 8 |
# File 'lib/rack/app/router/tree/env.rb', line 6 def current @request_path_parts[@index] end |
#next ⇒ Object
34 35 36 37 38 |
# File 'lib/rack/app/router/tree/env.rb', line 34 def next env = self.dup env.inc_index! env end |
#save_key ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/rack/app/router/tree/env.rb', line 25 def save_key if current =~ /^:\w+$/i @params[@index]= current.sub(/^:/, '') :ANY else current end end |
#type ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rack/app/router/tree/env.rb', line 14 def type case @request_path_parts.last when Rack::App::Constants::PATH::APPLICATION :APPLICATION when Rack::App::Constants::PATH::MOUNT_POINT :MOUNT_POINT else :ENDPOINT end end |