Class: DoctorSwagger::RootSwaggerDoc

Inherits:
SwaggerDoc show all
Defined in:
lib/doctor_swagger/root_swagger_doc.rb

Instance Method Summary collapse

Methods inherited from SwaggerDoc

#as_json, #endpoint

Constructor Details

#initialize(base_path_extension, options = {}, &block) ⇒ RootSwaggerDoc

Returns a new instance of RootSwaggerDoc.


4
5
6
7
8
9
10
11
12
13
14
# File 'lib/doctor_swagger/root_swagger_doc.rb', line 4

def initialize(base_path_extension, options = {}, &block)
  options[:swagger_version] ||= DoctorSwagger.swagger_version
  options[:api_version]     ||= DoctorSwagger.api_version
  options[:base_path]       ||= DoctorSwagger.base_path
  @swagger_version = options[:swagger_version]
  @api_version     = options[:api_version]
  @base_path       = try_call(options[:base_path])
  @base_path      += base_path_extension
  @endpoints       = []
  instance_eval(&block)
end