Merge pull request #20 from simplymeasured/feature/make-autorefresh-of-token-optional
[arvados.git] / lib / google / api_client.rb
index bcba0123c9dab94c471bbe068419406dbc0c2f6b..4c9ee03c7a9a7b1657f5f0418f884512b5f3326a 100644 (file)
@@ -19,8 +19,8 @@ require 'multi_json'
 require 'compat/multi_json'
 require 'stringio'
 
-require 'google/api_client/logging'
 require 'google/api_client/version'
+require 'google/api_client/logging'
 require 'google/api_client/errors'
 require 'google/api_client/environment'
 require 'google/api_client/discovery'
@@ -94,14 +94,14 @@ module Google
       end
       self.user_agent = options[:user_agent] || (
         "#{application_string} " +
-        "google-api-ruby-client/#{VERSION::STRING} " +
+        "google-api-ruby-client/#{Google::APIClient::VERSION::STRING} " +
          ENV::OS_VERSION
       ).strip
       # The writer method understands a few Symbols and will generate useful
       # default authentication mechanisms.
       self.authorization =
         options.key?(:authorization) ? options[:authorization] : :oauth_2
-      self.auto_refresh_token = options.fetch(:auto_refresh_token){ true }
+      self.auto_refresh_token = options.fetch(:auto_refresh_token) { true }
       self.key = options[:key]
       self.user_ip = options[:user_ip]
       @discovery_uris = {}
@@ -167,12 +167,6 @@ module Google
       return @authorization
     end
 
-    ##
-    # The application's API key issued by the API console.
-    #
-    # @return [String] The API key.
-    attr_accessor :key
-
     ##
     # The setting that controls whether or not the api client attempts to
     # refresh authorization when a 401 is hit in #execute. 
@@ -180,6 +174,12 @@ module Google
     # @return [Boolean]
     attr_accessor :auto_refresh_token
 
+    ##
+    # The application's API key issued by the API console.
+    #
+    # @return [String] The API key.
+    attr_accessor :key
+
     ##
     # The IP address of the user this request is being performed on behalf of.
     #