Class: InfunnelCli::CLI::Program

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

Instance Method Summary collapse

Instance Method Details

#allObject



26
27
28
29
30
31
32
33
# File 'lib/infunnel_cli/cli/program.rb', line 26

def all
  EloquaApiService::Program.new(account: options[:account]).all[:elements].each do |program|
    puts '-'*90
    program.each do |k, v|
        puts "#{black on_white  k}: #{v}"
    end
  end
end

#find(id) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/infunnel_cli/cli/program.rb', line 11

def find( id )
  EloquaApiService::Program.new(account: options[:account]).find(id: id).each do |k, v|
    if k == :steps
      puts 'Steps: '
      v.each do |_k, _v|
        find_step(_k[:id])
      end
    else
      puts "#{k}: #{v}"
    end
  end
end

#find_step(id) ⇒ Object



37
38
39
40
41
42
# File 'lib/infunnel_cli/cli/program.rb', line 37

def find_step(id)
  puts '-'*90
  EloquaApiService::Program.new(account: options[:account]).find_step(id).each do |k, v|
    puts "#{k}: #{v}"
  end
end