class CremulNameAndAddress

Attributes

nad_lines[R]

NAD segment in unstructured form: NAD+party-id+code+code+nad-line1+nad-line2+nad-line3+nad-line4+nad-line5

NAD segment in structured form (3 variants): NAD+party-id+code+code+nad-line OR NAD+party-id+code+nad-line OR NAD+party-id+nad-line

In the structured form the nad-line will have colon (:) as separator between the address parts

Party-IDs: MR - Beneficiary bank BE - Beneficiary, the ultimate recipient of the funds PL - Payor

type[R]

NAD segment in unstructured form: NAD+party-id+code+code+nad-line1+nad-line2+nad-line3+nad-line4+nad-line5

NAD segment in structured form (3 variants): NAD+party-id+code+code+nad-line OR NAD+party-id+code+nad-line OR NAD+party-id+nad-line

In the structured form the nad-line will have colon (:) as separator between the address parts

Party-IDs: MR - Beneficiary bank BE - Beneficiary, the ultimate recipient of the funds PL - Payor

Public Class Methods

new(nad_segment) click to toggle source
# File lib/cremul/cremul_name_and_address.rb, line 23
def initialize(nad_segment)
  s = nad_segment.split('+')
  @type = s[1].to_sym

  @nad_lines = []
  if s.size <= 5 # structured form
    addr = s[s.size-1].split(':')
    addr.each { |l| @nad_lines << l }
  else
    5.times do |i|
      @nad_lines << s[i+4]
    end
  end
end

Public Instance Methods

to_csv() click to toggle source
# File lib/cremul/cremul_name_and_address.rb, line 38
def to_csv
  csv = ''
  @nad_lines.each { |l| csv << l << ',' }
  csv.chomp(',')
end