Class: R2OAS::Schema::V3::ComponentsGenerator

Inherits:
BaseGenerator show all
Defined in:
lib/r2-oas/schema/v3/generator/components_generator.rb

Constant Summary

Constants inherited from Base

Base::SUPPORT_COMPONENTS_OBJECTS

Instance Method Summary collapse

Methods included from R2OAS::Sortable

#deep_sort

Methods inherited from Base

#support_components_objects

Constructor Details

#initialize(schema_data = {}, options = {}) ⇒ ComponentsGenerator

Returns a new instance of ComponentsGenerator.



11
12
13
14
15
# File 'lib/r2-oas/schema/v3/generator/components_generator.rb', line 11

def initialize(schema_data = {}, options = {})
  super(options)
  @components = schema_data['components'] || scehma_data[:components]
  @options = options
end

Instance Method Details

#generate_docsObject



17
18
19
20
21
22
23
# File 'lib/r2-oas/schema/v3/generator/components_generator.rb', line 17

def generate_docs
  support_components_objects.each do |object_name|
    generator_class(object_name).new(@components, @options.merge(
                                                    middle_category: object_name
                                                  )).generate_docs
  end
end