Sha256: 2945777104143366d11daab60d1caa6876d304953e3fc66bbf5259916729b31e

Contents?: true

Size: 831 Bytes

Versions: 41

Compression:

Stored size: 831 Bytes

Contents

# loader base class
class OpenAPIParser::SchemaLoader::Base
  # @param [String] variable_name
  # @param [Hash] options
  def initialize(variable_name, options)
    @variable_name = variable_name
    @schema_key = options[:schema_key] || variable_name
  end

  # @param [OpenAPIParser::Schemas::Base] _target_object
  # @param [Hash] _raw_schema
  # @return [Array<OpenAPIParser::Schemas::Base>, nil]
  def load_data(_target_object, _raw_schema)
    raise 'need implement'
  end

  private

    attr_reader :variable_name, :schema_key

    # create instance variable @variable_name using data
    # @param [OpenAPIParser::Schemas::Base] target
    # @param [String] variable_name
    # @param [Object] data
    def variable_set(target, variable_name, data)
      target.instance_variable_set("@#{variable_name}", data)
    end
end

Version data entries

41 entries across 41 versions & 2 rubygems

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