Module: GcfRuby
- Defined in:
- lib/gcf_ruby.rb,
lib/gcf_ruby/errors.rb,
lib/gcf_ruby/version.rb,
lib/generators/gcf_ruby/install_generator.rb
Overview
Main class for prediction
Defined Under Namespace
Modules: Generators Classes: AsyncError, AuthentificationError, Configuration, FailedValidationError, GcfError, InternalServerError, UnhandledError, WrongModelName
Constant Summary collapse
- VERSION =
"0.1.0"
Class Attribute Summary collapse
-
.configuration ⇒ Object
Returns the value of attribute configuration.
Class Method Summary collapse
- .configure {|configuration| ... } ⇒ Object
- .predict(model_name, params) ⇒ Object
- .predict_async(model_name, params, webhook_url) ⇒ Object
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
14 15 16 |
# File 'lib/gcf_ruby.rb', line 14 def configuration @configuration end |
Class Method Details
.configure {|configuration| ... } ⇒ Object
71 72 73 74 |
# File 'lib/gcf_ruby.rb', line 71 def self.configure(&block) self.configuration ||= Configuration.new yield configuration end |
.predict(model_name, params) ⇒ Object
16 17 18 |
# File 'lib/gcf_ruby.rb', line 16 def predict(model_name, params) post(model_name, formatted_params(params)) end |
.predict_async(model_name, params, webhook_url) ⇒ Object
20 21 22 |
# File 'lib/gcf_ruby.rb', line 20 def predict_async(model_name, params, webhook_url) post(model_name, formatted_params(params), webhook_url) end |