class SwaggerDocsGenerator::Actions::Schema

Create object swagger Schema

Attributes

definition[R]
type[R]

Public Class Methods

new(&block) click to toggle source
# File lib/swagger_docs_generator/parser/actions/schema.rb, line 7
def initialize(&block)
  @definition = nil
  @type = 'array'
  instance_eval(&block) if block_given?
end

Public Instance Methods

to_hash() click to toggle source
# File lib/swagger_docs_generator/parser/actions/schema.rb, line 13
def to_hash
  element = { type: @type }
  element.merge!(items: { '$ref': @definition })
end