Module: Swaggard

Defined in:
lib/swaggard.rb,
lib/swaggard/engine.rb,
lib/swaggard/version.rb,
lib/swaggard/swagger/tag.rb,
lib/swaggard/swagger/path.rb,
lib/swaggard/swagger/type.rb,
lib/swaggard/configuration.rb,
lib/swaggard/api_definition.rb,
lib/swaggard/parsers/models.rb,
lib/swaggard/parsers/routes.rb,
lib/swaggard/swagger/property.rb,
lib/swaggard/swagger/response.rb,
lib/swaggard/swagger/operation.rb,
lib/swaggard/swagger/definition.rb,
lib/swaggard/parsers/controllers.rb,
lib/swaggard/swagger/parameters/base.rb,
lib/swaggard/swagger/parameters/body.rb,
lib/swaggard/swagger/parameters/form.rb,
lib/swaggard/swagger/parameters/list.rb,
lib/swaggard/swagger/parameters/path.rb,
lib/swaggard/swagger/parameters/query.rb,
lib/generators/swaggard/install_generator.rb,
app/controllers/swaggard/swagger_controller.rb,
app/controllers/swaggard/application_controller.rb

Defined Under Namespace

Modules: Parsers, Swagger Classes: ApiDefinition, ApplicationController, Configuration, Engine, InstallGenerator, SwaggerController

Constant Summary collapse

VERSION =
'0.5.4'

Class Method Summary collapse

Class Method Details

.configurationObject



19
20
21
# File 'lib/swaggard.rb', line 19

def configuration
  @configuration ||= Swaggard::Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



15
16
17
# File 'lib/swaggard.rb', line 15

def configure
  yield configuration
end

.get_doc(host) ⇒ Object



35
36
37
38
39
40
41
42
43
# File 'lib/swaggard.rb', line 35

def get_doc(host)
  load!

  doc = @api.to_doc

  doc['host'] = host if doc['host'].blank?

  doc
end

.register_custom_yard_tags!Object

Register some custom yard tags



24
25
26
27
28
29
30
31
32
33
# File 'lib/swaggard.rb', line 24

def register_custom_yard_tags!
  ::YARD::Tags::Library.define_tag('Controller\'s tag',  :tag)
  ::YARD::Tags::Library.define_tag('Query parameter', :query_parameter)
  ::YARD::Tags::Library.define_tag('Form parameter',  :form_parameter)
  ::YARD::Tags::Library.define_tag('Body parameter',  :body_parameter)
  ::YARD::Tags::Library.define_tag('Parameter list',  :parameter_list)
  ::YARD::Tags::Library.define_tag('Response class',  :response_class)
  ::YARD::Tags::Library.define_tag('Response Root',  :response_root)
  ::YARD::Tags::Library.define_tag('Response Status',  :response_status)
end