Class: OasCore::Spec::RequestBody

Inherits:
Object
  • Object
show all
Includes:
Hashable, Specable
Defined in:
lib/oas_core/spec/request_body.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Hashable

generate_hash, #hash_key, #hash_representation, hash_representation_recursive, #public_instance_variables

Methods included from Specable

#as_json, #to_spec

Constructor Details

#initialize(specification) ⇒ RequestBody

Returns a new instance of RequestBody.



11
12
13
14
15
16
# File 'lib/oas_core/spec/request_body.rb', line 11

def initialize(specification)
  @specification = specification
  @description = ''
  @content = {} # a hash with media type objects
  @required = false
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



9
10
11
# File 'lib/oas_core/spec/request_body.rb', line 9

def content
  @content
end

#descriptionObject

Returns the value of attribute description.



9
10
11
# File 'lib/oas_core/spec/request_body.rb', line 9

def description
  @description
end

#requiredObject

Returns the value of attribute required.



9
10
11
# File 'lib/oas_core/spec/request_body.rb', line 9

def required
  @required
end

Instance Method Details

#oas_fieldsObject



18
19
20
# File 'lib/oas_core/spec/request_body.rb', line 18

def oas_fields
  %i[description content required]
end