Module: Google::Cloud::AutoML::Prediction
- Defined in:
- lib/google/cloud/automl.rb
Class Method Summary collapse
-
.new(version: , credentials: , scopes: , client_config: , timeout: ) ⇒ Object
AutoML Prediction API.
Class Method Details
.new(version: , credentials: , scopes: , client_config: , timeout: ) ⇒ Object
AutoML Prediction API.
On any input that is documented to expect a string parameter in snake_case or kebab-case, either of those cases is accepted.
203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/google/cloud/automl.rb', line 203 def self.new(*args, version: :v1beta1, **kwargs) unless AVAILABLE_VERSIONS.include?(version.to_s.downcase) raise "The version: #{version} is not available. The available versions " \ "are: [#{AVAILABLE_VERSIONS.join(", ")}]" end require "#{FILE_DIR}/#{version.to_s.downcase}" version_module = Google::Cloud::AutoML .constants .select {|sym| sym.to_s.downcase == version.to_s.downcase} .first Google::Cloud::AutoML.const_get(version_module)::Prediction.new(*args, **kwargs) end |