Class: InfunnelCli::CLI::Eloqua

Inherits:
Base
  • Object
show all
Defined in:
lib/infunnel_cli/cli/eloqua.rb

Instance Method Summary collapse

Instance Method Details

#all_loginsObject



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.
end

#default_loginObject



28
29
30
# File 'lib/infunnel_cli/cli/eloqua.rb', line 28

def 
  puts EloquaApiService::Credential.new.default.inspect
end

#loginObject



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 
  say("Login to eloqua and save credentials in keychain")
  company   = ask("Company:")
  user_name = ask("Username:")
  password  = ask("Password:")

   = EloquaApiService::.new
  response = .define_credentials(company: company, user_name: user_name, password: password)

  if response
    puts EloquaApiService::Credential.new.create(
      make_default: options[:default],
      options: {
        password: .eloqua_auth,
        account:  company,
        service:  response
      })
  end
end