Sha256: beefd6436c518c76f761f45f45c24f7c147272ee8311358c8e925bcb0663a0f8

Contents?: true

Size: 556 Bytes

Versions: 34

Compression:

Stored size: 556 Bytes

Contents

# frozen_string_literal: true

module GrapeSwagger
  module DocMethods
    class Version
      class << self
        def get(route)
          version = route.version
          # for grape version 0.16.2, the version can be a string like '[:v1, :v2]'
          # for grape version bigger than 0.16.2, the version can be a array like [:v1, :v2]
          if version.is_a?(String) && version.start_with?('[') && version.end_with?(']')
            instance_eval(version)
          else
            version
          end
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
grape-swagger-2.1.1 lib/grape-swagger/doc_methods/version.rb
grape-swagger-2.0.3 lib/grape-swagger/doc_methods/version.rb
grape-swagger-2.0.2 lib/grape-swagger/doc_methods/version.rb
grape-swagger-2.0.1 lib/grape-swagger/doc_methods/version.rb
grape-swagger-2.0.0 lib/grape-swagger/doc_methods/version.rb
grape-swagger-1.6.1 lib/grape-swagger/doc_methods/version.rb
grape-swagger-1.6.0 lib/grape-swagger/doc_methods/version.rb
gitlab-grape-swagger-1.5.0 lib/grape-swagger/doc_methods/version.rb
grape-swagger-1.5.0 lib/grape-swagger/doc_methods/version.rb
grape-swagger-1.4.2 lib/grape-swagger/doc_methods/version.rb
grape-swagger-1.4.1 lib/grape-swagger/doc_methods/version.rb
grape-swagger-1.4.0 lib/grape-swagger/doc_methods/version.rb
grape-swagger-1.3.1 lib/grape-swagger/doc_methods/version.rb
grape-swagger-1.3.0 lib/grape-swagger/doc_methods/version.rb
grape-swagger-1.2.1 lib/grape-swagger/doc_methods/version.rb
grape-swagger-1.2.0 lib/grape-swagger/doc_methods/version.rb
grape-swagger-1.1.0 lib/grape-swagger/doc_methods/version.rb
grape-swagger-1.0.0 lib/grape-swagger/doc_methods/version.rb
grape-swagger-0.34.2 lib/grape-swagger/doc_methods/version.rb
grape-swagger-0.34.1 lib/grape-swagger/doc_methods/version.rb