Class: OpenAPIParser::PathItemFinder
- Inherits:
-
Object
- Object
- OpenAPIParser::PathItemFinder
- Defined in:
- lib/openapi_parser/path_item_finder.rb
Defined Under Namespace
Classes: Result
Instance Method Summary collapse
-
#initialize(paths) ⇒ PathItemFinder
constructor
A new instance of PathItemFinder.
-
#operation_object(http_method, request_path) ⇒ Result?
find operation object and if not exist return nil.
Constructor Details
#initialize(paths) ⇒ PathItemFinder
Returns a new instance of PathItemFinder.
3 4 5 |
# File 'lib/openapi_parser/path_item_finder.rb', line 3 def initialize(paths) @paths = paths end |
Instance Method Details
#operation_object(http_method, request_path) ⇒ Result?
find operation object and if not exist return nil
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/openapi_parser/path_item_finder.rb', line 11 def operation_object(http_method, request_path) if (path_item_object = @paths.path[request_path]) if (op = path_item_object.operation(http_method)) return Result.new(path_item_object, op, request_path, {}) # find no path_params path end end # check with path_params parse_request_path(http_method, request_path) end |