Class: Openapi3Parser::NodeFactory::Object::NodeBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi3_parser/node_factory/object/node_builder.rb

Instance Method Summary collapse

Constructor Details

#initialize(input, factory) ⇒ NodeBuilder

Returns a new instance of NodeBuilder.



11
12
13
14
# File 'lib/openapi3_parser/node_factory/object/node_builder.rb', line 11

def initialize(input, factory)
  @input = input
  @factory = factory
end

Instance Method Details

#dataObject



16
17
18
19
20
21
22
23
# File 'lib/openapi3_parser/node_factory/object/node_builder.rb', line 16

def data
  check_required_fields
  check_unexpected_fields
  check_fields_valid
  input.each_with_object({}) do |(key, value), memo|
    memo[key] = resolve_value(key, value)
  end
end