lib/gateway/Parsers/header_parser.rb in stone_ecommerce-1.0.3 vs lib/gateway/Parsers/header_parser.rb in stone_ecommerce-1.2.3

- old
+ new

@@ -1,14 +1,17 @@ -class HeaderParser - def Parse(elements) - if elements.length < 4 - throw('The expected parameter count is 4') - end +module Gateway - header = Header.new - header.TransactionProcessedDate = Date.parse(elements[1]).strftime('%Y%m%d') - header.ReportFileCreateDate = Date.parse(elements[2]).strftime('%Y%m%d %H:%M:%S') - header.Version = elements[3].chomp + class HeaderParser + def Parse(elements) + if elements.length < 4 + throw('The expected parameter count is 4') + end - return header + header = Header.new + header.TransactionProcessedDate = Date.parse(elements[1]).strftime('%Y%m%d') + header.ReportFileCreateDate = Date.parse(elements[2]).strftime('%Y%m%d %H:%M:%S') + header.Version = elements[3].chomp + + return header + end end end \ No newline at end of file