Module: Google::Cloud
- Defined in:
- lib/google-cloud-language.rb,
lib/google/cloud/language.rb,
lib/google/cloud/language/project.rb,
lib/google/cloud/language/service.rb,
lib/google/cloud/language/version.rb,
lib/google/cloud/language/document.rb,
lib/google/cloud/language/annotation.rb,
lib/google/cloud/language/credentials.rb,
lib/google/cloud/language/v1beta1/language_service_pb.rb,
lib/google/cloud/language/v1beta1/language_service_api.rb,
lib/google/cloud/language/v1beta1/language_service_services_pb.rb
Defined Under Namespace
Modules: Language
Class Method Summary collapse
-
.language(project = nil, keyfile = nil, scope: nil, retries: nil, timeout: nil) ⇒ Google::Cloud::Language::Project
Creates a new object for connecting to the Language service.
Instance Method Summary collapse
-
#language(scope: nil, retries: nil, timeout: nil) ⇒ Google::Cloud::Language::Project
Creates a new object for connecting to the Language service.
Class Method Details
.language(project = nil, keyfile = nil, scope: nil, retries: nil, timeout: nil) ⇒ Google::Cloud::Language::Project
Creates a new object for connecting to the Language service. Each call creates a new connection.
For more information on connecting to Google Cloud see the Authentication Guide.
101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/google-cloud-language.rb', line 101 def self.language project = nil, keyfile = nil, scope: nil, retries: nil, timeout: nil require "google/cloud/language" project ||= Google::Cloud::Language::Project.default_project if keyfile.nil? credentials = Google::Cloud::Language::Credentials.default scope: scope else credentials = Google::Cloud::Language::Credentials.new( keyfile, scope: scope) end Google::Cloud::Language::Project.new( Google::Cloud::Language::Service.new( project, credentials, retries: retries, timeout: timeout)) end |
Instance Method Details
#language(scope: nil, retries: nil, timeout: nil) ⇒ Google::Cloud::Language::Project
Creates a new object for connecting to the Language service. Each call creates a new connection.
For more information on connecting to Google Cloud see the Authentication Guide.
62 63 64 65 66 |
# File 'lib/google-cloud-language.rb', line 62 def language scope: nil, retries: nil, timeout: nil Google::Cloud.language @project, @keyfile, scope: scope, retries: (retries || @retries), timeout: (timeout || @timeout) end |