Module: Anthropic::Models::DocumentBlockParam::Source
- Extended by:
- Internal::Type::Union
- Defined in:
- lib/anthropic/models/document_block_param.rb,
sig/anthropic/models/document_block_param.rbs
Overview
Defined Under Namespace
Modules: Type
Class Method Summary collapse
-
.new(type:, **args) ⇒ Anthropic::Models::Base64PDFSource, ...
Creates a new instance of the variant class whose
typematches the given value, passing the remaining arguments to its constructor. - .values ⇒ Array<Symbol>
- .variants ⇒ Array(Anthropic::Models::Base64PDFSource, Anthropic::Models::PlainTextSource, Anthropic::Models::ContentBlockSource, Anthropic::Models::URLPDFSource, Anthropic::Models::FileDocumentSource)
Instance Method Summary collapse
Methods included from Internal::Type::Union
==, ===, coerce, derefed_variants, dump, hash, inspect, to_sorbet_type, variants
Methods included from Internal::Util::SorbetRuntimeSupport
#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type
Methods included from Internal::Type::Converter
#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info
Class Method Details
.new(type:, **args) ⇒ Anthropic::Models::Base64PDFSource, ...
Creates a new instance of the variant class whose type matches the given
value, passing the remaining arguments to its constructor.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/anthropic/models/document_block_param.rb', line 101 def self.new(type:, **args) case type.to_sym when :base64 Anthropic::Base64PDFSource.new(**args) when :text Anthropic::PlainTextSource.new(**args) when :content Anthropic::ContentBlockSource.new(**args) when :url Anthropic::URLPDFSource.new(**args) when :file Anthropic::FileDocumentSource.new(**args) else raise ArgumentError, "unknown type: #{type}" end end |
.values ⇒ Array<Symbol>
|
|
# File 'lib/anthropic/models/document_block_param.rb', line 75
|
.variants ⇒ Array(Anthropic::Models::Base64PDFSource, Anthropic::Models::PlainTextSource, Anthropic::Models::ContentBlockSource, Anthropic::Models::URLPDFSource, Anthropic::Models::FileDocumentSource)
|
|
# File 'lib/anthropic/models/document_block_param.rb', line 79
|
Instance Method Details
#self?.variants ⇒ ::Array[Anthropic::Models::DocumentBlockParam::source]
68 |
# File 'sig/anthropic/models/document_block_param.rbs', line 68
def self?.variants: -> ::Array[Anthropic::Models::DocumentBlockParam::source]
|