Skip to content

Instantly share code, notes, and snippets.

@jeremyd
Created October 31, 2012 07:16
Show Gist options
  • Save jeremyd/3985578 to your computer and use it in GitHub Desktop.
Save jeremyd/3985578 to your computer and use it in GitHub Desktop.
def self.load_preferences
e = getPreferences(Context::MODE_PRIVATE)
email = e.getString("Email", "")
pass = e.getString("Password", "")
host = e.getString("RightScale Host", "")
account_id = e.getString("Account ID", "")
return { :email => email, :pass => pass, :host => host, :account_id => account_id }
end
def self.save_preferences(options)
e = getPreferences(Context::MODE_PRIVATE).edit
e.putString("Email", options[:email])
e.putString("Password", options[:pass])
e.putString("RightScale Host", options[:host])
e.putString("Account ID", options[:account_id])
e.commit
toast "Saved Settings"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment