Class: DoctorSwagger::PostBody
- Inherits:
-
PostParameter
- Object
- Parameter
- PostParameter
- DoctorSwagger::PostBody
- Defined in:
- lib/doctor_swagger/post_body.rb
Constant Summary
Constants inherited from Parameter
DoctorSwagger::Parameter::ALLOWED_TYPES
Instance Method Summary collapse
- #as_json ⇒ Object
- #example(example) ⇒ Object
-
#initialize(&block) ⇒ PostBody
constructor
A new instance of PostBody.
Methods inherited from PostParameter
Methods inherited from Parameter
#allow_multiple!, #allowable_values, #allowable_values_as_json, #description, #required!, #type
Constructor Details
#initialize(&block) ⇒ PostBody
Returns a new instance of PostBody.
3 4 5 |
# File 'lib/doctor_swagger/post_body.rb', line 3 def initialize(&block) super(:body, &block) end |
Instance Method Details
#as_json ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/doctor_swagger/post_body.rb', line 11 def as_json(*) if @example && !@example.empty? super.merge('example' => @example) else super end end |
#example(example) ⇒ Object
7 8 9 |
# File 'lib/doctor_swagger/post_body.rb', line 7 def example(example) @example = example end |