Module: Swagger::Builder

Defined in:
lib/swagger/builder.rb

Overview

An object for building a Swagger document. Coerces and validates data types as create the document, but does not enforce required fields until you call #Swagger::Bash#build.

Class Method Summary collapse

Class Method Details

.builder(opts = {}) ⇒ Object


90
91
92
93
94
95
# File 'lib/swagger/builder.rb', line 90

def self.builder(opts = {})
  version = opts[:version] || '2.0'
  target_class = target_api_class(version)
  klass = Swagger::Bash.infect(target_class)
  klass.new({})
end