Class: GrapeSwagger::DocMethods::TagNameDescription

Inherits:
Object
  • Object
show all
Defined in:
lib/grape-swagger/doc_methods/tag_name_description.rb

Class Method Summary collapse

Class Method Details

.build(paths) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/grape-swagger/doc_methods/tag_name_description.rb', line 7

def build(paths)
  paths.values.each_with_object([]) do |path, memo|
    tags = path.values.first[:tags]
    next if tags.nil?

    case tags
    when String
      memo << build_memo(tags)
    when Array
      path.values.first[:tags].each do |tag|
        memo << build_memo(tag)
      end
    end
  end.uniq
end