Class: Swagger::DefinitionSection

Inherits:
Hashie::Dash
  • Object
show all
Includes:
Hashie::Extensions::Coercion, Hashie::Extensions::IndifferentAccess, Attachable
Defined in:
lib/swagger/definition_section.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Attachable

#attach_parent, #attach_to_children, #root

Constructor Details

#initialize(hash) ⇒ DefinitionSection

Returns a new instance of DefinitionSection.



9
10
11
12
# File 'lib/swagger/definition_section.rb', line 9

def initialize(hash)
  super
  attach_to_children
end

Instance Attribute Details

#parentObject

Returns the value of attribute parent.



7
8
9
# File 'lib/swagger/definition_section.rb', line 7

def parent
  @parent
end

Class Method Details

.required_section(name, type) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



29
30
31
32
# File 'lib/swagger/definition_section.rb', line 29

def self.required_section(name, type)
  property name, required: true
  coerce_key name, type
end

.section(name, type) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



19
20
21
22
# File 'lib/swagger/definition_section.rb', line 19

def self.section(name, type)
  property name
  coerce_key name, type
end