Class: Absa::H2h::Transmission::AccountHolderVerification

Inherits:
Set
  • Object
show all
Defined in:
lib/absa-h2h/account_holder_verification.rb

Defined Under Namespace

Classes: ExternalAccountDetail, Header, InternalAccountDetail, Trailer

Instance Attribute Summary

Attributes inherited from Set

#records

Instance Method Summary collapse

Methods inherited from Set

build, for_record, hash_from_s, #header, #initialize, is_trailer_record?, layout_rules, module_name, partial_class_name, process_record, record_type, record_types, #to_s, #trailer, trailer_id, #transactions

Constructor Details

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

Instance Method Details

#validate!Object



10
11
12
13
14
15
16
17
18
# File 'lib/absa-h2h/account_holder_verification.rb', line 10

def validate! 
  unless trailer.no_det_recs == transactions.length.to_s
    raise "no_det_recs mismatch: expected #{trailer.no_det_recs}, got #{transactions.length}" 
  end

  unless transactions.map {|t| t.seq_no} == (1..(transactions.length)).map(&:to_s).to_a
    raise "seq_no mismatch: #{transactions.map {|t| t.seq_no}}"
  end             
end