Class: InfunnelCli::CLI::Eloqua
- Defined in:
- lib/infunnel_cli/cli/eloqua.rb
Instance Method Summary collapse
Instance Method Details
#all_logins ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/infunnel_cli/cli/eloqua.rb', line 33 def all_logins puts yellow 'Accounts:' puts EloquaApiService::Credential.new.all.map { |k| "#{bold k.account}, pod: #{k.service}" } puts '' puts yellow 'Default:' puts bold EloquaApiService::Credential.new.default.account end |
#default_login ⇒ Object
28 29 30 |
# File 'lib/infunnel_cli/cli/eloqua.rb', line 28 def default_login puts EloquaApiService::Credential.new.default.inspect end |
#login ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/infunnel_cli/cli/eloqua.rb', line 7 def login say("Login to eloqua and save credentials in keychain") company = ask("Company:") user_name = ask("Username:") password = ask("Password:") login = EloquaApiService::Login.new response = login.define_credentials(company: company, user_name: user_name, password: password) if response puts EloquaApiService::Credential.new.create( make_default: [:default], options: { password: login.eloqua_auth, account: company, service: response }) end end |