Richo Healey avatar Richo Healey committed 259c02e

Fix internal API and hose refs to cf

Comments (0)

Files changed (2)

lib/twat/actions.rb

       pin = gets.chomp
       begin
         access_token = token_request.get_access_token(oauth_verifier: pin)
-        cf[opts[:account]] = {
+        config[opts[:account]] = {
           oauth_token: access_token.token,
           oauth_token_secret: access_token.secret
         }
-        cf.save! 
+        config.save!
       rescue OAuth::Unauthorized
         puts "Couldn't authenticate you, did you enter the pin correctly?"
       end
     end
 
     def delete
-      if delete_account(config[:account])
-        cf.save!
+      if config.delete(opts[:account])
+        config.save!
         puts "Successfully deleted"
       else
         puts "No such account"
     private
 
     def twitter_auth
-      conf = config[opts[:account]]
       Twitter.configure do |twit|
-        conf.each do |key, value|
+        account.each do |key, value|
           twit.send("#{key}=", value)
         end
         Config.consumer_info.each do |key, value|
       end
     end
 
+    def account
+      @account ||= config[opts[:account]]
+    end
+
   end
 end

lib/twat/config.rb

       }
     end
 
-    # pretty wrappers
-    #
-    def delete_account(account)
-      config.delete(config[account])
-    end
-
   end
 end
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.