Sha256: 17ef6c2990b2d729e7eac4408a5295b957709d7bc10468dd453bc1b652472746

Contents?: true

Size: 490 Bytes

Versions: 11

Compression:

Stored size: 490 Bytes

Contents

module GrapeSwagger
  module DocMethods
    class Headers
      class << self
        def parse(route)
          route.headers.to_a.map do |route_header|
            route_header.tap do |header|
              hash = header[1]
              description = hash.delete('description')
              hash[:documentation] = { desc: description, in: 'header' }
              hash[:type] = hash['type'].titleize if hash['type']
            end
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
grape-swagger-0.26.1 lib/grape-swagger/doc_methods/headers.rb
grape-swagger-0.26.0 lib/grape-swagger/doc_methods/headers.rb
grape-swagger-0.25.3 lib/grape-swagger/doc_methods/headers.rb
grape-swagger-0.25.2 lib/grape-swagger/doc_methods/headers.rb
grape-swagger-0.25.1 lib/grape-swagger/doc_methods/headers.rb
grape-swagger-0.25.0 lib/grape-swagger/doc_methods/headers.rb
grape-swagger-0.24.0 lib/grape-swagger/doc_methods/headers.rb
grape-swagger-0.23.0 lib/grape-swagger/doc_methods/headers.rb
grape-swagger-0.22.0 lib/grape-swagger/doc_methods/headers.rb
grape-swagger-0.21.0 lib/grape-swagger/doc_methods/headers.rb
grape-swagger-0.20.3 lib/grape-swagger/doc_methods/headers.rb