class CamtParser::Creditor
Attributes
Public Class Methods
Source
# File lib/camt_parser/general/creditor.rb, line 6 def initialize(xml_data) @xml_data = xml_data end
Public Instance Methods
Source
# File lib/camt_parser/general/creditor.rb, line 28 def bank_name @bank_name ||= xml_data.xpath('RltdAgts/CdtrAgt/FinInstnId/Nm/text()').text end
Source
# File lib/camt_parser/general/creditor.rb, line 21 def bic @bic ||= [ xml_data.xpath('RltdAgts/CdtrAgt/FinInstnId/BIC/text()').text, xml_data.xpath('RltdAgts/CdtrAgt/FinInstnId/BICFI/text()').text, ].reject(&:empty?).first.to_s end
Source
# File lib/camt_parser/general/creditor.rb, line 17 def iban @iban ||= xml_data.xpath('RltdPties/CdtrAcct/Id/IBAN/text()').text end
Source
# File lib/camt_parser/general/creditor.rb, line 10 def name @name ||= [ xml_data.xpath('RltdPties/Cdtr/Nm/text()').text, xml_data.xpath('RltdPties/Cdtr/Pty/Nm/text()').text, ].reject(&:empty?).first.to_s end
Source
# File lib/camt_parser/general/creditor.rb, line 33 def postal_address # May be missing postal_address = [ xml_data.xpath('RltdPties/Cdtr/PstlAdr'), xml_data.xpath('RltdPties/Cdtr/Pty/PstlAdr'), ].reject(&:empty?).first return nil if postal_address == nil || postal_address.empty? @address ||= CamtParser::PostalAddress.new(postal_address) end
@return [CamtParser::PostalAddress, nil]