Class: WeakSwaggerParameters::Definitions::Params

Inherits:
ParamContainer show all
Defined in:
lib/weak_swagger_parameters/definitions/params.rb

Instance Method Summary collapse

Methods inherited from ParamContainer

#apply_docs, #apply_validations

Constructor Details

#initialize(&block) ⇒ Params

Returns a new instance of Params.



6
7
8
9
# File 'lib/weak_swagger_parameters/definitions/params.rb', line 6

def initialize(&block)
  @child_definitions = []
  instance_eval(&block)
end

Instance Method Details

#body(&block) ⇒ Object



11
12
13
# File 'lib/weak_swagger_parameters/definitions/params.rb', line 11

def body(&block)
  @child_definitions << WeakSwaggerParameters::Definitions::Body.new(&block)
end

#path(&block) ⇒ Object



19
20
21
# File 'lib/weak_swagger_parameters/definitions/params.rb', line 19

def path(&block)
  @child_definitions << WeakSwaggerParameters::Definitions::Path.new(&block)
end

#query(&block) ⇒ Object



15
16
17
# File 'lib/weak_swagger_parameters/definitions/params.rb', line 15

def query(&block)
  @child_definitions << WeakSwaggerParameters::Definitions::Query.new(&block)
end