Class: Swagger::Blocks::SchemaNode

Inherits:
Node
  • Object
show all
Defined in:
lib/swagger/blocks.rb

Overview

Instance Attribute Summary

Attributes inherited from Node

#name, #version

Instance Method Summary collapse

Methods inherited from Node

#as_json, call, #data, #is_swagger_1_2?, #is_swagger_2_0?, #key, #keys

Instance Method Details

#allOf(&block) ⇒ Object



666
667
668
# File 'lib/swagger/blocks.rb', line 666

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

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



680
681
682
# File 'lib/swagger/blocks.rb', line 680

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

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



662
663
664
# File 'lib/swagger/blocks.rb', line 662

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

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



670
671
672
673
674
# File 'lib/swagger/blocks.rb', line 670

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

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



676
677
678
# File 'lib/swagger/blocks.rb', line 676

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