class CamtParser::Format054::Notification
Attributes
Public Class Methods
Source
# File lib/camt_parser/054/notification.rb, line 7 def initialize(xml_data) @xml_data = xml_data end
Source
# File lib/camt_parser/054/notification.rb, line 47 def self.parse(xml) self.new Nokogiri::XML(xml).xpath('Ntfctn') end
@return [CamtParser::Format054::Notification]
Public Instance Methods
Source
# File lib/camt_parser/054/notification.rb, line 32 def account @account ||= Account.new(xml_data.xpath('Acct').first) end
@return [Account]
Source
# File lib/camt_parser/054/notification.rb, line 37 def entries @entries ||= xml_data.xpath('Ntry').map{ |x| Entry.new(x) } end
@return [Array<Entry>]
Source
# File lib/camt_parser/054/notification.rb, line 22 def from_date_time @from_date_time ||= (x = xml_data.xpath('FrToDt/FrDtTm')).empty? ? nil : Time.parse(x.first.content) end
@return [Time, nil]
Source
# File lib/camt_parser/054/notification.rb, line 17 def generation_date @generation_date ||= Time.parse(xml_data.xpath('CreDtTm/text()').text) end
@return [Time]
Source
# File lib/camt_parser/054/notification.rb, line 12 def identification @identification ||= xml_data.xpath('Id/text()').text end
@return [String]
Source
# File lib/camt_parser/054/notification.rb, line 42 def source xml_data.to_s end
@return [String]
Source
# File lib/camt_parser/054/notification.rb, line 27 def to_date_time @to_date_time ||= (x = xml_data.xpath('FrToDt/ToDtTm')).empty? ? nil : Time.parse(x.first.content) end
@return [Time, nil]