Class: Fictium::OpenApi::V3Exporter::PathGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/fictium/exporters/open_api/v3_exporter/path_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document) ⇒ PathGenerator

Returns a new instance of PathGenerator.



7
8
9
# File 'lib/fictium/exporters/open_api/v3_exporter/path_generator.rb', line 7

def initialize(document)
  @document = document
end

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document.



5
6
7
# File 'lib/fictium/exporters/open_api/v3_exporter/path_generator.rb', line 5

def document
  @document
end

Instance Method Details

#generateObject



11
12
13
14
15
16
17
# File 'lib/fictium/exporters/open_api/v3_exporter/path_generator.rb', line 11

def generate
  {}.tap do |paths|
    document.resources.each do |resource|
      generate_from_resource(paths, resource)
    end
  end
end