class Swagger::Document
Public Class Methods
new(base_path, opts = {})
click to toggle source
# File lib/swagger/document.rb, line 3 def initialize base_path, opts = {} defaults = { :swaggerVersion => "1.1", :basePath => base_path, :apis => [], } @values = defaults.merge opts end
Public Instance Methods
api(path, opts = {}) { |a| ... }
click to toggle source
# File lib/swagger/document.rb, line 12 def api path, opts = {} a = Api.new(path, opts) yield(a) @values[:apis] << a a end
as_json(options)
click to toggle source
# File lib/swagger/document.rb, line 19 def as_json options @values.as_json options end