Module: OpenAI::Internal::Util::SorbetRuntimeSupport Private
- Included in:
- OpenAI::Internal, Transport::BaseClient, Transport::PooledNetRequester, Type::ArrayOf, Type::BaseModel, Type::Boolean, Type::Converter, Type::Enum, Type::HashOf, Type::Union, Type::Unknown, OpenAI::Internal::Util
- Defined in:
- lib/openai/internal/util.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Defined Under Namespace
Classes: MissingSorbetRuntimeError
Class Method Summary collapse
- .to_sorbet_type(type) ⇒ Object private
Instance Method Summary collapse
- #const_missing(name) ⇒ Object private
- #define_sorbet_constant!(name, &blk) ⇒ Object private
- #sorbet_constant_defined?(name) ⇒ Boolean private
- #to_sorbet_type ⇒ Object private
Class Method Details
.to_sorbet_type(type) ⇒ Object
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.
870 871 872 873 874 875 876 877 |
# File 'lib/openai/internal/util.rb', line 870 def to_sorbet_type(type) case type in OpenAI::Internal::Util::SorbetRuntimeSupport type.to_sorbet_type else type end end |
Instance Method Details
#const_missing(name) ⇒ Object
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.
835 836 837 838 839 840 841 842 843 844 |
# File 'lib/openai/internal/util.rb', line 835 def const_missing(name) super unless sorbet_runtime_constants.key?(name) unless Object.const_defined?(:T) = "Trying to access a Sorbet constant #{name.inspect} without `sorbet-runtime`." raise MissingSorbetRuntimeError.new() end sorbet_runtime_constants.fetch(name).call end |
#define_sorbet_constant!(name, &blk) ⇒ Object
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.
857 |
# File 'lib/openai/internal/util.rb', line 857 def define_sorbet_constant!(name, &blk) = sorbet_runtime_constants.store(name, blk) |
#sorbet_constant_defined?(name) ⇒ Boolean
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.
851 |
# File 'lib/openai/internal/util.rb', line 851 def sorbet_constant_defined?(name) = sorbet_runtime_constants.key?(name) |
#to_sorbet_type ⇒ Object
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.
862 |
# File 'lib/openai/internal/util.rb', line 862 def to_sorbet_type = raise NotImplementedError |