Class: R2OAS::Schema::V3::FromFiles::OpenapiObject
- Inherits:
-
BaseObject
- Object
- BaseObject
- R2OAS::Schema::V3::FromFiles::OpenapiObject
- Defined in:
- lib/r2-oas/schema/v3/object/from_files/openapi_object.rb
Instance Method Summary collapse
-
#initialize(doc, opts = {}) ⇒ OpenapiObject
constructor
A new instance of OpenapiObject.
- #to_doc ⇒ Object
Methods inherited from BaseObject
Constructor Details
#initialize(doc, opts = {}) ⇒ OpenapiObject
Returns a new instance of OpenapiObject.
14 15 16 17 18 19 |
# File 'lib/r2-oas/schema/v3/object/from_files/openapi_object.rb', line 14 def initialize(doc, opts = {}) super(opts) @doc = doc set_root_doc(doc) set_components_name_list(doc) end |
Instance Method Details
#to_doc ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/r2-oas/schema/v3/object/from_files/openapi_object.rb', line 21 def to_doc execute_transform_plugins(:setup) # MEMO: # Make sure paths_doc is run first # This is because the components object is stored in the store by executing paths_doc # and it is looped to generate the component document. result = { 'openapi' => '3.0.0', 'info' => info_doc, 'tags' => @doc['tags'], 'paths' => paths_doc, 'externalDocs' => external_docs_doc, 'servers' => @doc['servers'], 'components' => components_doc } execute_transform_plugins(:teardown) result end |