require 'google/api_client/reference'
require 'google/api_client/result'
+
module Google
# TODO(bobaman): Document all this stuff.
# @option options [String] :host ("www.googleapis.com")
# The API hostname used by the client. This rarely needs to be changed.
# @option options [String] :application_name
- # The name and version of the application using the client. This should
- # be given in the form `"{name}/{version}"`.
+ # The name of the application using the client.
+ # @option options [String] :application_version
+ # The version number of the application using the client.
# @option options [String] :user_agent
# ("{app_name} google-api-ruby-client/{version} {os_name}/{os_version}")
# The user agent used by the client. Most developers will want to
self.host = options["host"] || 'www.googleapis.com'
# Most developers will want to leave this value alone and use the
# application_name option.
+ application_string = (
+ options["application_name"] ? (
+ "#{options["application_name"]}/" +
+ "#{options["application_version"] || '0.0.0'}"
+ ) : ""
+ )
self.user_agent = options["user_agent"] || (
- (options["application_name"] || '')
- 'google-api-ruby-client/' + VERSION::STRING +
- ' ' + ENV::OS_VERSION
+ "#{application_string} " +
+ "google-api-ruby-client/#{VERSION::STRING} " +
+ ENV::OS_VERSION
).strip
# The writer method understands a few Symbols and will generate useful
# default authentication mechanisms.
##
# The application's API key issued by the API console.
#
- # @return [String] The API key..
+ # @return [String] The API key.
attr_accessor :key
##
+# Copyright 2010 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
module Google
class APIClient
module ENV