Module: Apidoco::ApplicationHelper

Defined in:
app/helpers/apidoco/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#build_documentation_array(documentations) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'app/helpers/apidoco/application_helper.rb', line 9

def build_documentation_array(documentations)
  documentation_array = documentations.map do |documentation|
    if documentation[:is_folder]
      build_documentation_array(documentation[:children])
    else
      documentation
    end
  end

  documentation_array.flatten
end

#documentation_versions(version_parser) ⇒ Object



3
4
5
6
7
# File 'app/helpers/apidoco/application_helper.rb', line 3

def documentation_versions(version_parser)
  version_parser.documentations.map do |documentation|
    { name: documentation.name, path: api_path(id: documentation.name) }
  end
end