Class: OpenAPIParser::SchemaLoader::HashBodyLoader

Inherits:
Creator
  • Object
show all
Defined in:
lib/openapi_parser/concerns/schema_loader/hash_body_loader.rb

Overview

hash body object loader

Instance Method Summary collapse

Constructor Details

#initialize(variable_name, options) ⇒ HashBodyLoader

Returns a new instance of HashBodyLoader.

Parameters:

  • variable_name (String)
  • options (Hash)


5
6
7
8
9
# File 'lib/openapi_parser/concerns/schema_loader/hash_body_loader.rb', line 5

def initialize(variable_name, options)
  super(variable_name, options)

  @reject_keys = options[:reject_keys] ? options[:reject_keys].map(&:to_s) : []
end

Instance Method Details

#load_data(target_object, raw_schema) ⇒ Array<OpenAPIParser::Schemas::Base>?

Parameters:

Returns:



14
15
16
17
# File 'lib/openapi_parser/concerns/schema_loader/hash_body_loader.rb', line 14

def load_data(target_object, raw_schema)
  # raw schema always exist because if not exist' this object don't create
  create_hash_body_objects(target_object, raw_schema)
end