Class: Rage::OpenAPI::Parsers::SharedReference
- Inherits:
-
Object
- Object
- Rage::OpenAPI::Parsers::SharedReference
- Defined in:
- lib/rage/openapi/parsers/shared_reference.rb
Instance Method Summary collapse
-
#initialize ⇒ SharedReference
constructor
A new instance of SharedReference.
- #known_definition?(str) ⇒ Boolean
- #parse(component_path) ⇒ Object
Constructor Details
#initialize ⇒ SharedReference
Returns a new instance of SharedReference.
4 5 |
# File 'lib/rage/openapi/parsers/shared_reference.rb', line 4 def initialize(**) end |
Instance Method Details
#known_definition?(str) ⇒ Boolean
7 8 9 |
# File 'lib/rage/openapi/parsers/shared_reference.rb', line 7 def known_definition?(str) str.start_with?("#/components") end |
#parse(component_path) ⇒ Object
11 12 13 |
# File 'lib/rage/openapi/parsers/shared_reference.rb', line 11 def parse(component_path) { "$ref" => component_path } if valid_components_ref?(component_path) end |