Class: Swagger::Blocks::Nodes::ParameterNode

Inherits:
Swagger::Blocks::Node show all
Defined in:
lib/swagger/blocks/nodes/parameter_node.rb

Overview

Constant Summary

Constants inherited from Swagger::Blocks::Node

Swagger::Blocks::Node::VERSION_2, Swagger::Blocks::Node::VERSION_3

Instance Attribute Summary

Attributes inherited from Swagger::Blocks::Node

#name, #version

Instance Method Summary collapse

Methods inherited from Swagger::Blocks::Node

#as_json, call, #data, #is_openapi_3_0?, #is_swagger_2_0?, #key, #keys, #ref?, #static_ref?, #value_as_json

Instance Method Details

#example(name, inline_keys = nil, &block) ⇒ Object


14
15
16
17
# File 'lib/swagger/blocks/nodes/parameter_node.rb', line 14

def example(name, inline_keys = nil, &block)
  self.data[:examples] ||= {}
  self.data[:examples][name] = Swagger::Blocks::Nodes::ExampleNode.call(version: version, inline_keys: inline_keys, &block)
end

#items(inline_keys = nil, &block) ⇒ Object


10
11
12
# File 'lib/swagger/blocks/nodes/parameter_node.rb', line 10

def items(inline_keys = nil, &block)
  self.data[:items] = Swagger::Blocks::Nodes::ItemsNode.call(version: version, inline_keys: inline_keys, &block)
end

#schema(inline_keys = nil, &block) ⇒ Object


6
7
8
# File 'lib/swagger/blocks/nodes/parameter_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