Class: ConvenientService::Examples::Standard::V1::RequestParams::Utils::HTTP::Request::ParsePath
- Inherits:
-
Command
- Object
- ConvenientService::Examples::Standard::V1::RequestParams::Utils::HTTP::Request::ParsePath
- Defined in:
- lib/convenient_service/examples/standard/v1/request_params/utils/http/request/parse_path.rb
Overview
TODO: Specs.
Instance Attribute Summary collapse
-
#http_string ⇒ Object
readonly
Returns the value of attribute http_string.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(http_string:) ⇒ ParsePath
constructor
A new instance of ParsePath.
Constructor Details
#initialize(http_string:) ⇒ ParsePath
Returns a new instance of ParsePath.
22 23 24 |
# File 'lib/convenient_service/examples/standard/v1/request_params/utils/http/request/parse_path.rb', line 22 def initialize(http_string:) @http_string = http_string end |
Instance Attribute Details
#http_string ⇒ Object (readonly)
Returns the value of attribute http_string.
20 21 22 |
# File 'lib/convenient_service/examples/standard/v1/request_params/utils/http/request/parse_path.rb', line 20 def http_string @http_string end |
Instance Method Details
#call ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/convenient_service/examples/standard/v1/request_params/utils/http/request/parse_path.rb', line 30 def call webrick_request = ::WEBrick::HTTPRequest.new(::WEBrick::Config::HTTP) webrick_request.parse(::StringIO.new(http_string)) webrick_request.path rescue ::WEBrick::HTTPStatus::BadRequest nil end |