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-0.7.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.6.1 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.6.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.5.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.4.1 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.4.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.3.1 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.3.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.2.7 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.2.6 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.2.5 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.2.4 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.2.3 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.2.2 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.2.1 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.2.0 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.1.9 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.1.8 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.1.7 lib/openapi_parser/concerns/schema_loader/objects_loader.rb
openapi_parser-0.1.6 lib/openapi_parser/concerns/schema_loader/objects_loader.rb