C0 code coverage information
Generated on Sun Dec 21 22:36:24 +0000 2008 with
rcov 0.8.1.2
Code reported as executed by Ruby looks like
this... and this: this line is also marked as
covered. Lines considered as run by rcov, but
not reported by Ruby, look like this, and
this: these lines were inferred by rcov (using simple heuristics).
Finally, here's a line marked as not
executed.
1 module PostalMethods 2 3 module UtilityMethods 4 5
require 'base64' 6
7 def
get_letter_details(id) 8
raise PostalMethods::NoPreparationException unless self.prepared
9 10 ## get a letter as pdf over the
wire 11 rv =
@rpc_driver.getLetterDetails(:Username => self.username, :Password =>
self.password, :ID => id) 12 13
status_code = rv.getLetterDetailsResult.resultCode.to_i 14 letter_data =
rv.getLetterDetailsResult 15 16 if
status_code == -3000 # successfully received the req 17 return [letter_data, status_code]
18 elsif
API_STATUS_CODES.has_key?(status_code) 19 instance_eval("raise
APIStatusCode#{status_code.to_s.gsub(/( |\-)/,'')}Exception")
20 end 21 raise
PostalMethods::GenericCodeError 22 end 23 24
def get_pdf(id) 25 raise
PostalMethods::NoPreparationException unless self.prepared 26 27 ## get a letter as pdf over the wire 28 begin 29 rv = @rpc_driver.getPDF(:Username
=> self.username, :Password => self.password, :ID => id)
30 rescue
SOAP::FaultError 31
raise APIStatusCode3150Exception 32 end 33 34
status_code = rv.getPDFResult.resultCode.to_i 35 36 if status_code == -3000 # successfully received the req
37 return
Base64.decode64(rv.getPDFResult.fileData) # the data returned is base64...
38 elsif
API_STATUS_CODES.has_key?(status_code) 39 instance_eval("raise
APIStatusCode#{status_code.to_s.gsub(/( |\-)/,'')}Exception")
40 end 41 raise
PostalMethods::GenericCodeError 42 end 43 44
def cancel_delivery(id) 45
raise PostalMethods::NoPreparationException unless self.prepared
46 47 ## get a letter as pdf over the
wire 48 rv =
@rpc_driver.cancelDelivery(:Username => self.username, :Password =>
self.password, :ID => id) 49 50
status_code = rv.cancelDeliveryResult.to_i 51 52 if
status_code == -3000 # successfully received the req 53 return true 54 elsif
API_STATUS_CODES.has_key?(status_code) 55 instance_eval("raise
APIStatusCode#{status_code.to_s.gsub(/( |\-)/,'')}Exception")
56 end 57 raise
PostalMethods::GenericCodeError 58 end 59 end 60 end
Generated using the rcov
code coverage analysis tool for Ruby version 0.8.1.2.