lib/biro/gateways/bvs/builders/debits_response_builder.rb in biro-0.5.1 vs lib/biro/gateways/bvs/builders/debits_response_builder.rb in biro-0.6.1
- old
+ new
@@ -1,45 +1,49 @@
-class DebitsResponseBuilder
- def initialize body
- @body = body.gsub("\n", '').scan(/<PRE>([^<>]*)<\/PRE>/imu).flatten[0]
- end
+module Biro
+ module Bvs
+ class DebitsResponseBuilder
+ def initialize body
+ @body = body.gsub("\n", '').scan(/<PRE>([^<>]*)<\/PRE>/imu).flatten[0]
+ end
- def transaction
- @body[0..7]
- end
+ def transaction
+ @body[0..7]
+ end
- def version
- @body[8..9]
- end
+ def version
+ @body[8..9]
+ end
- def reserved_applicant
- @body[10..19]
- end
+ def reserved_applicant
+ @body[10..19]
+ end
- def reserved_bvs
- @body[20..39]
- end
+ def reserved_bvs
+ @body[20..39]
+ end
- def response_type
- @body[56]
- end
+ def response_type
+ @body[56]
+ end
- def return_code
- @body[57]
- end
+ def return_code
+ @body[57]
+ end
- def response_text_size
- @body[58..61].to_i
- end
+ def response_text_size
+ @body[58..61].to_i
+ end
- def response_text
- @body[62,response_text_size]
- end
+ def response_text
+ @body[62,response_text_size]
+ end
- def error_message
- response_text[8..100]
- end
+ def error_message
+ response_text[8..100]
+ end
- def debits_info
- response_text[6]
+ def debits_info
+ response_text[6]
+ end
+ end
end
end