Class: Zencoder::Response

Inherits:
Base
  • Object
show all
Defined in:
lib/zencoder-cli/response.rb

Instance Method Summary collapse

Instance Method Details

#process_for_cliObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/zencoder-cli/response.rb', line 4

def process_for_cli
  if success?
    self
  else
    if errors.any?
      puts "Errors:\n#{errors.map{|error| "* "+error }.join("\n")}"
    else
      puts "ERROR\n-----\n\n#{body}\n\nHTTP Response Code\n------------------\n#{code}"
    end
    exit(1)
  end
end