class CamtParser::Record
Attributes
Public Class Methods
Source
# File lib/camt_parser/general/record.rb, line 6 def initialize(xml_data) @xml_data = xml_data @amount = xml_data.xpath('Amt/text()').text end
Public Instance Methods
Source
# File lib/camt_parser/general/record.rb, line 11 def amount CamtParser::Misc.to_amount(@amount) end
Source
# File lib/camt_parser/general/record.rb, line 15 def amount_in_cents CamtParser::Misc.to_amount_in_cents(@amount) end
Source
# File lib/camt_parser/general/record.rb, line 27 def charges_included? @charges_included ||= xml_data.xpath('ChrgInclInd/text()').text.downcase == 'true' end
Source
# File lib/camt_parser/general/record.rb, line 19 def currency @currency ||= xml_data.xpath('Amt/@Ccy').text end
Source
# File lib/camt_parser/general/record.rb, line 31 def debit @debit ||= xml_data.xpath('CdtDbtInd/text()').text.upcase == 'DBIT' end
Source
# File lib/camt_parser/general/record.rb, line 23 def type @type ||= CamtParser::Type::Builder.build_type(xml_data.xpath('Tp')) end