lib/biro/gateways/bvs/builders/debits_response_builder.rb in biro-0.6.2 vs lib/biro/gateways/bvs/builders/debits_response_builder.rb in biro-0.6.3

- old
+ new

@@ -1,10 +1,10 @@ module Biro module Bvs class DebitsResponseBuilder - def initialize body - @body = body.gsub("\n", '').scan(/<PRE>([^<>]*)<\/PRE>/imu).flatten[0] + def initialize(body) + @body = build(body) end def transaction @body[0..7] end @@ -41,9 +41,13 @@ response_text[8..100] end def debits_info response_text[6] + end + + def build(body) + body.gsub("\n", '').gsub("\t", '').gsub("\\t", '').gsub("\\n", '').scan(/<PRE>([^<>]*)<\/PRE>/imu).flatten[0] end end end end