class Hbci::Services::BaseReceiver

Attributes

connector[R]
dialog[R]
iban[R]

Public Class Methods

new(connector, dialog, iban, version = nil) click to toggle source
# File lib/hbci/services/base_receiver.rb, line 10
def initialize(connector, dialog, iban, version = nil)
  @connector = connector
  @dialog = dialog
  @iban = Ibanizator.iban_from_string(iban)
  @version = version

  # raise "The version #{@version} is not supported" if version && !supported_versions.include?(@version)
end

Public Instance Methods

perform() click to toggle source
# File lib/hbci/services/base_receiver.rb, line 19
def perform
  raise NotImplementedError, "#{self.class.name}#perform is an abstract method."
end

Private Instance Methods

request_successful?() click to toggle source
# File lib/hbci/services/base_receiver.rb, line 25
def request_successful?
  hirmg = @response.find('HIRMG')
  return false if hirmg && hirmg.ret_val_1.code[0].to_i == 9

  hnvsd = @response.find('HNVSD')
  hirmg = hnvsd.find('HIRMG')
  return false if hirmg && hirmg.ret_val_1.code[0].to_i == 9

  true
end
supported_versions() click to toggle source
# File lib/hbci/services/base_receiver.rb, line 40
def supported_versions
  raise NotImplementedError, "#{self.class.name}#supported_versions is an abstract method."
end
version() click to toggle source
# File lib/hbci/services/base_receiver.rb, line 36
def version
  @version ||= supported_versions.max
end