Class: OasRails::Spec::Response

Inherits:
Object
  • Object
show all
Includes:
Hashable, Specable
Defined in:
lib/oas_rails/spec/response.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) ⇒ Response

Returns a new instance of Response.



9
10
11
12
13
# File 'lib/oas_rails/spec/response.rb', line 9

def initialize(specification)
  @specification = specification
  @description = ""
  @content = {} # Hash with {content: MediaType}
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



7
8
9
# File 'lib/oas_rails/spec/response.rb', line 7

def code
  @code
end

#contentObject

Returns the value of attribute content.



7
8
9
# File 'lib/oas_rails/spec/response.rb', line 7

def content
  @content
end

#descriptionObject

Returns the value of attribute description.



7
8
9
# File 'lib/oas_rails/spec/response.rb', line 7

def description
  @description
end

Instance Method Details

#oas_fieldsObject



15
16
17
# File 'lib/oas_rails/spec/response.rb', line 15

def oas_fields
  [:description, :content]
end