Class: Swaggard::Swagger::Parameters::List

Inherits:
Base
  • Object
show all
Defined in:
lib/swaggard/swagger/parameters/list.rb

Instance Attribute Summary

Attributes inherited from Base

#name

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ List

Returns a new instance of List.



8
9
10
11
# File 'lib/swaggard/swagger/parameters/list.rb', line 8

def initialize(string)
  @in = 'query'
  parse(string)
end

Instance Method Details

#to_docObject



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/swaggard/swagger/parameters/list.rb', line 13

def to_doc
  doc = super

  doc.merge(
    {
      'type'            => 'array',
      'items'           => { 'type' => @data_type },
      'enum'            => @list_values
    }
  )
end