Class: Biro::Bvs::ScoreResponseBuilder
- Inherits:
-
Object
- Object
- Biro::Bvs::ScoreResponseBuilder
- Defined in:
- lib/biro/gateways/bvs/builders/score_response_builder.rb
Instance Method Summary collapse
- #build(body) ⇒ Object
- #error_message ⇒ Object
-
#initialize(body) ⇒ ScoreResponseBuilder
constructor
A new instance of ScoreResponseBuilder.
- #reserved_applicant ⇒ Object
- #reserved_bvs ⇒ Object
- #response_text ⇒ Object
- #response_text_description ⇒ Object
- #response_text_document ⇒ Object
- #response_text_document_type ⇒ Object
- #response_text_init ⇒ Object
- #response_text_is_present ⇒ Object
- #response_text_name ⇒ Object
- #response_text_over ⇒ Object
- #response_text_result_score ⇒ Object
- #response_text_size ⇒ Object
- #response_text_type ⇒ Object
- #response_type ⇒ Object
- #return_code ⇒ Object
- #search_number ⇒ Object
- #search_type ⇒ Object
- #search_version ⇒ Object
- #service_code ⇒ Object
- #transaction ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(body) ⇒ ScoreResponseBuilder
Returns a new instance of ScoreResponseBuilder.
4 5 6 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 4 def initialize(body) @body = build(body) end |
Instance Method Details
#build(body) ⇒ Object
96 97 98 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 96 def build(body) body.gsub("\n", '').gsub("\t", '').gsub("\\t", '').gsub("\\n", '').scan(/<PRE>([^<>]*)<\/PRE>/imu).flatten[0] end |
#error_message ⇒ Object
92 93 94 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 92 def response_text[8..100] || "" end |
#reserved_applicant ⇒ Object
16 17 18 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 16 def reserved_applicant @body[10..19] end |
#reserved_bvs ⇒ Object
20 21 22 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 20 def reserved_bvs @body[20..39] end |
#response_text ⇒ Object
52 53 54 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 52 def response_text @body[71,response_text_size] || "" end |
#response_text_description ⇒ Object
84 85 86 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 84 def response_text_description response_text[141..160] end |
#response_text_document ⇒ Object
72 73 74 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 72 def response_text_document response_text[8..21] end |
#response_text_document_type ⇒ Object
68 69 70 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 68 def response_text_document_type response_text[7] end |
#response_text_init ⇒ Object
56 57 58 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 56 def response_text_init response_text[0..2] end |
#response_text_is_present ⇒ Object
64 65 66 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 64 def response_text_is_present response_text[6] end |
#response_text_name ⇒ Object
76 77 78 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 76 def response_text_name response_text[22..136] || "" end |
#response_text_over ⇒ Object
88 89 90 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 88 def response_text_over response_text[160..500] end |
#response_text_result_score ⇒ Object
80 81 82 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 80 def response_text_result_score response_text[137..140] end |
#response_text_size ⇒ Object
48 49 50 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 48 def response_text_size @body[67..70].to_i end |
#response_text_type ⇒ Object
60 61 62 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 60 def response_text_type response_text[3..5] end |
#response_type ⇒ Object
36 37 38 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 36 def response_type @body[58] end |
#return_code ⇒ Object
40 41 42 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 40 def return_code @body[59] end |
#search_number ⇒ Object
44 45 46 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 44 def search_number @body[60..66] end |
#search_type ⇒ Object
28 29 30 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 28 def search_type @body[48..55] end |
#search_version ⇒ Object
32 33 34 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 32 def search_version @body[56..57] end |
#service_code ⇒ Object
24 25 26 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 24 def service_code @body[40..47] end |
#transaction ⇒ Object
8 9 10 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 8 def transaction @body[0..7] end |
#version ⇒ Object
12 13 14 |
# File 'lib/biro/gateways/bvs/builders/score_response_builder.rb', line 12 def version @body[8..9] end |