class Biro::Bvs::Response
Attributes
body[R]
Public Class Methods
new(responses)
click to toggle source
# File lib/biro/gateways/bvs/response.rb, line 8 def initialize(responses) @body = { } [:score, :debits].each { |r| @body[r] = responses[r].body if responses[r] } end
Public Instance Methods
debits?()
click to toggle source
# File lib/biro/gateways/bvs/response.rb, line 33 def debits? debits_body.debits_info == 'S' end
debits_error_message()
click to toggle source
# File lib/biro/gateways/bvs/response.rb, line 37 def debits_error_message debits_body.error_message.strip unless returning_debits? end
document()
click to toggle source
# File lib/biro/gateways/bvs/response.rb, line 25 def document score_body.response_text_document.to_i end
name()
click to toggle source
# File lib/biro/gateways/bvs/response.rb, line 21 def name score_body.response_text_name.strip end
returning_debits?()
click to toggle source
# File lib/biro/gateways/bvs/response.rb, line 17 def returning_debits? debits_body.return_code == "0" end
returning_score?()
click to toggle source
# File lib/biro/gateways/bvs/response.rb, line 13 def returning_score? score_body.return_code == "0" end
score_error_message()
click to toggle source
# File lib/biro/gateways/bvs/response.rb, line 41 def score_error_message score_body.error_message.strip unless returning_score? end
scores()
click to toggle source
# File lib/biro/gateways/bvs/response.rb, line 29 def scores score_body.response_text_result_score.to_i end
Private Instance Methods
debits_body()
click to toggle source
# File lib/biro/gateways/bvs/response.rb, line 51 def debits_body DebitsResponseBuilder.new @body[:debits] end
score_body()
click to toggle source
# File lib/biro/gateways/bvs/response.rb, line 47 def score_body ScoreResponseBuilder.new @body[:score] end