Class: TropoREST::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/tropo-rest/cli.rb

Class Method Summary collapse

Class Method Details

.startObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/tropo-rest/cli.rb', line 5

def self.start
  puts "Setting up your session..."

  tokens = {tropo: {voice: ARGV[0], messaging: ARGV[1]}, troplets: {voice: ARGV[2], messaging: ARGV[3]}}
  unless tokens[:tropo][:voice].present?
    print "Enter your Tropo voice token: "
    tokens[:tropo][:voice] = gets
  end
  unless tokens[:tropo][:messaging].present?
    print "Enter your Tropo messaging token: "
    tokens[:tropo][:messaging] = gets
  end
  unless tokens[:troplets][:voice].present?
    print "Enter your Troplets voice token: "
    tokens[:troplets][:voice] = gets
  end
  unless tokens[:troplets][:messaging].present?
    print "Enter your Troplets messaging token: "
    tokens[:troplets][:messaging] = gets
  end

  TropoREST.tokens = tokens
  pry
end