Sha256: 6a657fcc84523ac01c1252bca819712ef00d9e39d9683f6e8565e0e60a674b48

Contents?: true

Size: 788 Bytes

Versions: 1

Compression:

Stored size: 788 Bytes

Contents

require "grape-swagger-rails/engine"

module GrapeSwaggerRails
  class Options < Struct.new(:url, :api_key_name, :api_key_type, :api_auth, :headers, :app_name, :app_url, :authentication_proc)
    def authenticate_with(&block)
      self.authentication_proc = block
    end
  end
  
  mattr_accessor :options
  
  self.options = Options.new(
    
    url:                  '/swagger_doc.json',
    app_name:             'Swagger',
    app_url:              'http://swagger.wordnik.com',
    
    headers:              {},
    
    api_auth:             '',        # 'basic'
    api_key_name:         'api_key', # 'Authorization'
    api_key_type:         'query',   # 'header'
    
    authentication_proc:  nil # Proc used as a controller before filter that returns a boolean
  )
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
grape-swagger-rails-0.0.8 lib/grape-swagger-rails.rb