Method: OpenAI::Internal::Type::ArrayOf#initialize

Defined in:
lib/openai/internal/type/array_of.rb

#initialize(type_info, spec = {}) ⇒ ArrayOf

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ArrayOf.

Parameters:

  • type_info (Hash{Symbol=>Object}, Proc, OpenAI::Internal::Type::Converter, Class)
  • spec (Hash{Symbol=>Object}) (defaults to: {})

    .

    @option spec [NilClass, TrueClass, FalseClass, Integer, Float, Symbol] :const

    @option spec [Proc] :enum

    @option spec [Proc] :union

    @option spec [Boolean] :"nil?"



149
150
151
152
# File 'lib/openai/internal/type/array_of.rb', line 149

def initialize(type_info, spec = {})
  @item_type_fn = OpenAI::Internal::Type::Converter.type_info(type_info || spec)
  @nilable = spec.fetch(:nil?, false)
end