class Skeleton::Structure

Attributes

base_path[RW]
describe[RW]
description[RW]
external_docs[RW]
host[RW]
terms[RW]
title[RW]
version[RW]

Public Instance Methods

configure() { |self| ... } click to toggle source
# File lib/skeleton/structure.rb, line 20
def configure(&block)
  return self unless block

  if block.arity == 0
    self.instance_eval(&block)
  else
    yield(self)
  end

  self
end
consume(*types) click to toggle source
# File lib/skeleton/structure.rb, line 84
def consume(*types)
  types.flatten.each { |t| consumes.add(t.to_s) }
end
consumes() click to toggle source
# File lib/skeleton/structure.rb, line 36
def consumes
  @consumes ||= Set.new
end
contact() click to toggle source
# File lib/skeleton/structure.rb, line 52
def contact
  @contact ||= Skeleton::Contact.new
end
define_model(name, options={}, &block) click to toggle source
# File lib/skeleton/structure.rb, line 140
def define_model(name, options={}, &block)
  models[name] = Skeleton::Model.new(name: name)
  models[name].instance_eval(&block) if block
  models[name]
end
define_parameter(name, &block) click to toggle source
# File lib/skeleton/structure.rb, line 110
def define_parameter(name, &block)
  parameters[name] = Skeleton::Parameter.new
  parameters[name].instance_eval(&block) if block
  parameters[name]
end
define_path(path, options={}, &block) click to toggle source
# File lib/skeleton/structure.rb, line 134
def define_path(path, options={}, &block)
  paths[path] = Skeleton::Path.new
  paths[path].instance_eval(&block) if block
  paths[path]
end
define_response(name, &block) click to toggle source
# File lib/skeleton/structure.rb, line 104
def define_response(name, &block)
  responses[name] = Skeleton::Response.new
  responses[name].instance_eval(&block) if block
  responses[name]
end
define_scope(name, &block) click to toggle source
# File lib/skeleton/structure.rb, line 116
def define_scope(name, &block)
  scopes[name] = Skeleton::Scope.new
  scopes[name].instance_eval(&block) if block
  scopes[name]
end
define_security(name, &block) click to toggle source
# File lib/skeleton/structure.rb, line 122
def define_security(name, &block)
  security[name] = Skeleton::SecurityScheme.new(name: name)
  security[name].instance_eval(&block) if block
  security[name]
end
define_tag(name, &block) click to toggle source
# File lib/skeleton/structure.rb, line 128
def define_tag(name, &block)
  tags[name] = Skeleton::Tag.new(name: name)
  tags[name].instance_eval(&block) if block
  tags[name]
end
license() click to toggle source
# File lib/skeleton/structure.rb, line 44
def license
  @license ||= Skeleton::License.new
end
models() click to toggle source
# File lib/skeleton/structure.rb, line 76
def models
  @models ||= {}
end
parameters() click to toggle source
# File lib/skeleton/structure.rb, line 60
def parameters
  @parameters ||= {}
end
parameters?() click to toggle source
# File lib/skeleton/structure.rb, line 92
def parameters?
  !parameters.empty?
end
paths() click to toggle source
# File lib/skeleton/structure.rb, line 72
def paths
  @paths ||= {}
end
produce(*types) click to toggle source
# File lib/skeleton/structure.rb, line 88
def produce(*types)
  types.flatten.each { |t| produces.add(t.to_s) }
end
produces() click to toggle source
# File lib/skeleton/structure.rb, line 40
def produces
  @produces ||= Set.new
end
responses() click to toggle source
# File lib/skeleton/structure.rb, line 56
def responses
  @responses ||= {}
end
responses?() click to toggle source
# File lib/skeleton/structure.rb, line 96
def responses?
  !responses.empty?
end
scheme(*types) click to toggle source
# File lib/skeleton/structure.rb, line 80
def scheme(*types)
  types.flatten.each { |t| schemes.add(t.to_s) }
end
schemes() click to toggle source
# File lib/skeleton/structure.rb, line 32
def schemes
  @schemes ||= Set.new
end
scopes() click to toggle source
# File lib/skeleton/structure.rb, line 64
def scopes
  @scopes ||= {}
end
secure?() click to toggle source
# File lib/skeleton/structure.rb, line 100
def secure?
  !security.empty?
end
security() click to toggle source
# File lib/skeleton/structure.rb, line 68
def security
  @security ||= {}
end
tags() click to toggle source
# File lib/skeleton/structure.rb, line 48
def tags
  @tags ||= {}
end