Class: Rage::OpenAPI::Parsers::SharedReference

Inherits:
Object
  • Object
show all
Defined in:
lib/rage/openapi/parsers/shared_reference.rb

Instance Method Summary collapse

Constructor Details

#initializeSharedReference

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

Returns:

  • (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