class Fictium::OpenApi::V3Exporter::PathGenerator

Attributes

document[R]

Public Class Methods

new(document) click to toggle source
# File lib/fictium/exporters/open_api/v3_exporter/path_generator.rb, line 7
def initialize(document)
  @document = document
end

Public Instance Methods

generate() click to toggle source
# 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

Private Instance Methods

generate_from_action(paths, action) click to toggle source
# File lib/fictium/exporters/open_api/v3_exporter/path_generator.rb, line 27
def generate_from_action(paths, action)
  path_formatter.add_path(paths, action)
end
generate_from_resource(paths, resource) click to toggle source
# File lib/fictium/exporters/open_api/v3_exporter/path_generator.rb, line 21
def generate_from_resource(paths, resource)
  resource.actions.each do |action|
    generate_from_action(paths, action)
  end
end
path_formatter() click to toggle source
# File lib/fictium/exporters/open_api/v3_exporter/path_generator.rb, line 31
def path_formatter
  @path_formatter ||= PathFormatter.new
end