Class: Swagger::Blocks::Nodes::SchemaNode

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

Overview

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_swagger_2_0?, #key, #keys

Instance Method Details

#allOf(&block) ⇒ Object


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

def allOf(&block)
  self.data[:allOf] = Swagger::Blocks::Nodes::AllOfNode.call(version: version, &block)
end

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


24
25
26
# File 'lib/swagger/blocks/nodes/schema_node.rb', line 24

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

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


6
7
8
# File 'lib/swagger/blocks/nodes/schema_node.rb', line 6

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

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


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

def property(name, inline_keys = nil, &block)
  self.data[:properties] ||= Swagger::Blocks::Nodes::PropertiesNode.new
  self.data[:properties].version = version
  self.data[:properties].property(name, inline_keys, &block)
end

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


20
21
22
# File 'lib/swagger/blocks/nodes/schema_node.rb', line 20

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