Class: Swagger::Blocks::Nodes::ResponseNode
Overview
Constant Summary
Swagger::Blocks::Node::VERSION_2, Swagger::Blocks::Node::VERSION_3
Instance Attribute Summary
#name, #version
Instance Method Summary
collapse
#as_json, call, #data, #is_openapi_3_0?, #is_swagger_2_0?, #key, #keys, #ref?, #static_ref?, #value_as_json
Instance Method Details
#content(type, inline_keys = nil, &block) ⇒ Object
16
17
18
19
|
# File 'lib/swagger/blocks/nodes/response_node.rb', line 16
def content(type, inline_keys = nil, &block)
self.data[:content] ||= {}
self.data[:content][type] = Swagger::Blocks::Nodes::ContentNode.call(version: version, inline_keys: inline_keys, &block)
end
|
#example(name = nil, inline_keys = nil, &block) ⇒ Object
21
22
23
24
25
26
27
28
|
# File 'lib/swagger/blocks/nodes/response_node.rb', line 21
def example(name = nil, inline_keys = nil, &block)
if name.nil?
self.data[:example] = Swagger::Blocks::Nodes::ExampleNode.call(version: version, inline_keys: inline_keys, &block)
else
self.data[:examples] ||= {}
self.data[:examples][name] = Swagger::Blocks::Nodes::ExampleNode.call(version: version, inline_keys: inline_keys, &block)
end
end
|
10
11
12
13
14
|
# File 'lib/swagger/blocks/nodes/response_node.rb', line 10
def (head, inline_keys = nil, &block)
self.data[:headers] ||= {}
self.data[:headers][head] = Swagger::Blocks::Nodes::HeaderNode.call(version: version, inline_keys: inline_keys, &block)
end
|
#link(name, inline_keys = nil, &block) ⇒ Object
30
31
32
33
|
# File 'lib/swagger/blocks/nodes/response_node.rb', line 30
def link(name, inline_keys = nil, &block)
self.data[:links] ||= {}
self.data[:links][name] = Swagger::Blocks::Nodes::LinkNode.call(version: version, inline_keys: inline_keys, &block)
end
|
#schema(inline_keys = nil, &block) ⇒ Object
6
7
8
|
# File 'lib/swagger/blocks/nodes/response_node.rb', line 6
def schema(inline_keys = nil, &block)
self.data[:schema] = Swagger::Blocks::Nodes::SchemaNode.call(version: version, inline_keys: inline_keys, &block)
end
|