make methods private
authorVolker Zöpfel <volker@zoepfel.de>
Thu, 14 Nov 2013 16:40:54 +0000 (17:40 +0100)
committerVolker Zöpfel <volker@zoepfel.de>
Thu, 14 Nov 2013 16:40:54 +0000 (17:40 +0100)
lib/google/api_client/auth/storage.rb

index 2fa18eab8d634c31d78379b5c53d974a6fd3f1ab..1fc080eb5b3f95834e16128354a40e89067f6e6b 100644 (file)
@@ -29,7 +29,6 @@ module Google
       # @return [Object] Storage object.
       attr_accessor :store
 
-
       # @return [Signet::OAuth2::Client]
       attr_reader :authorization
 
@@ -43,9 +42,16 @@ module Google
       end
 
       ##
-      # Attempt to read in credentials from the specified store.
-      def load_credentials
-        store.load_credentials
+      # Write the credentials to the specified store.
+      #
+      # @params [Signet::OAuth2::Client] authorization
+      #    Optional authorization instance. If not provided, the authorization
+      #    already associated with this instance will be written.
+      def write_credentials(authorization=nil)
+        @authorization = authorization if authorization
+        if @authorization.refresh_token
+          store.write_credentials(credentials_hash)
+        end
       end
 
       def authorize
@@ -64,6 +70,14 @@ module Google
         self.write_credentials
       end
 
+      private
+
+      ##
+      # Attempt to read in credentials from the specified store.
+      def load_credentials
+        store.load_credentials
+      end
+
       ##
       # @return [Hash] with credentials
       def credentials_hash
@@ -78,19 +92,6 @@ module Google
           :issued_at             => @authorization.issued_at.to_i
         }
       end
-
-      ##
-      # Write the credentials to the specified store.
-      #
-      # @params [Signet::OAuth2::Client] authorization
-      #    Optional authorization instance. If not provided, the authorization
-      #    already associated with this instance will be written.
-      def write_credentials(authorization=nil)
-        @authorization = authorization if authorization
-        if @authorization.refresh_token
-          store.write_credentials(credentials_hash)
-        end
-      end
     end
   end
 end