Class: Absa::H2h::Transmission::Eft::ContraRecord

Inherits:
Record
  • Object
show all
Defined in:
lib/absa-h2h/eft.rb

Instance Method Summary collapse

Methods inherited from Record

#initialize

Constructor Details

This class inherits a constructor from Absa::H2h::Transmission::Record

Instance Method Details

#contra_record?Boolean

Returns:

  • (Boolean)


168
169
170
# File 'lib/absa-h2h/eft.rb', line 168

def contra_record?
  true
end

#validate!(options = {}) ⇒ Object



172
173
174
175
176
177
178
# File 'lib/absa-h2h/eft.rb', line 172

def validate!(options={})
  super(options)
  raise "homing_branch: Should match the user branch. Got #{@homing_branch}. Expected #{@user_branch}." unless @homing_branch == @user_branch
  raise "homing_account_number: Should match the user nominated account number. Got #{@homing_account_number}. Expected #{@user_nominated_account}." unless @homing_account_number == @user_nominated_account
  raise "user_ref: Position 1 - 10 is compulsory. Please provide users abbreviated name." if @user_ref[0..9].blank?
  raise "user_ref: Position 11 - 16 is compulsory and must be set to 'CONTRA'. Got #{@user_ref[10..15]}" if @user_ref[10..15] != "CONTRA"
end