Class: WeakSwaggerParameters::Definitions::HashRef

Inherits:
Object
  • Object
show all
Includes:
PropertyContainer
Defined in:
lib/weak_swagger_parameters/definitions/hash_ref.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ HashRef

Returns a new instance of HashRef.



8
9
10
# File 'lib/weak_swagger_parameters/definitions/hash_ref.rb', line 8

def initialize(&block)
  instance_eval(&block) if block.present?
end

Instance Method Details

#apply_docs(parent_node) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/weak_swagger_parameters/definitions/hash_ref.rb', line 12

def apply_docs(parent_node)
  definitions = child_definitions

  parent_node.instance_eval do
    schema do
      definitions.each { |definition| definition.apply_docs(self) }
    end
  end
end