Sha256: 92eeeeccbf32b095580e33ed886a1fc851e6d58856d4b0d57fba06afd4670876

Contents?: true

Size: 760 Bytes

Versions: 40

Compression:

Stored size: 760 Bytes

Contents

# Specific Object loader (defined by klass option)
class OpenAPIParser::SchemaLoader::ObjectsLoader < OpenAPIParser::SchemaLoader::Creator
  # @param [OpenAPIParser::Schemas::Base] target_object
  # @param [Hash] raw_schema
  # @return [Array<OpenAPIParser::Schemas::Base>, nil]
  def load_data(target_object, raw_schema)
    obj = create_attr_object(target_object, raw_schema[schema_key.to_s])
    [obj]
  end

  private

    # @return [OpenAPIParser::Schemas::Base]
    def create_attr_object(target_object, schema)
      ref = build_object_reference_from_base(target_object.object_reference, schema_key)

      data = build_openapi_object_from_option(target_object, ref, schema)
      variable_set(target_object, variable_name, data)
      data
    end
end

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
openapi_parser-2.2.2 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-2.2.1 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-2.2.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-2.1.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-2.0.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser_firetail-1.0.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-1.0.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-1.0.0.beta1 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.15.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.14.1 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.14.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.13.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.12.1 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.12.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.11.2 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.11.1 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.11.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.10.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.9.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.8.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb