Class: HttpRouter::Request
- Inherits:
-
Object
- Object
- HttpRouter::Request
- Defined in:
- lib/http_router/request.rb
Instance Attribute Summary (collapse)
-
- (Object) continue
Returns the value of attribute continue.
-
- (Object) extra_env
Returns the value of attribute extra_env.
-
- (Object) params
Returns the value of attribute params.
-
- (Object) passed_with
Returns the value of attribute passed_with.
-
- (Object) path
Returns the value of attribute path.
-
- (Object) rack_request
(also: #rack)
Returns the value of attribute rack_request.
Instance Method Summary (collapse)
-
- (Request) initialize(path, rack_request, perform_call)
constructor
A new instance of Request.
- - (Object) joined_path
- - (Boolean) path_finished?
- - (Object) perform_call
- - (Boolean) testing_405?
- - (Object) to_s
Constructor Details
- (Request) initialize(path, rack_request, perform_call)
A new instance of Request
5 6 7 8 9 10 11 12 |
# File 'lib/http_router/request.rb', line 5 def initialize(path, rack_request, perform_call) @rack_request, @perform_call = rack_request, perform_call @path = URI.unescape(path).split(/\//) @path.shift if @path.first == '' @path.push('') if path[-1] == ?/ @extra_env = {} @params = [] end |
Instance Attribute Details
- (Object) continue
Returns the value of attribute continue
3 4 5 |
# File 'lib/http_router/request.rb', line 3 def continue @continue end |
- (Object) extra_env
Returns the value of attribute extra_env
3 4 5 |
# File 'lib/http_router/request.rb', line 3 def extra_env @extra_env end |
- (Object) params
Returns the value of attribute params
3 4 5 |
# File 'lib/http_router/request.rb', line 3 def params @params end |
- (Object) passed_with
Returns the value of attribute passed_with
3 4 5 |
# File 'lib/http_router/request.rb', line 3 def passed_with @passed_with end |
- (Object) path
Returns the value of attribute path
3 4 5 |
# File 'lib/http_router/request.rb', line 3 def path @path end |
- (Object) rack_request Also known as: rack
Returns the value of attribute rack_request
3 4 5 |
# File 'lib/http_router/request.rb', line 3 def rack_request @rack_request end |
Instance Method Details
- (Object) joined_path
14 15 16 |
# File 'lib/http_router/request.rb', line 14 def joined_path @path * '/' end |
- (Boolean) path_finished?
30 31 32 |
# File 'lib/http_router/request.rb', line 30 def path_finished? @path.size == 0 or @path.size == 1 && @path.first == '' end |
- (Object) perform_call
18 19 20 |
# File 'lib/http_router/request.rb', line 18 def perform_call @perform_call == true end |
- (Boolean) testing_405?
22 23 24 |
# File 'lib/http_router/request.rb', line 22 def testing_405? @perform_call == 405 end |
- (Object) to_s
26 27 28 |
# File 'lib/http_router/request.rb', line 26 def to_s "request path, #{path.inspect}" end |