Class: CamtParser::Format054::Notification
- Inherits:
-
Object
- Object
- CamtParser::Format054::Notification
- Defined in:
- lib/camt_parser/054/notification.rb
Class Method Summary collapse
Instance Method Summary collapse
- #account ⇒ Object
- #entries ⇒ Object
- #from_date_time ⇒ Object
- #generation_date ⇒ Object
- #identification ⇒ Object
-
#initialize(xml_data) ⇒ Notification
constructor
A new instance of Notification.
- #source ⇒ Object
- #to_date_time ⇒ Object
Constructor Details
#initialize(xml_data) ⇒ Notification
Returns a new instance of Notification.
4 5 6 |
# File 'lib/camt_parser/054/notification.rb', line 4 def initialize(xml_data) @xml_data = xml_data end |
Class Method Details
.parse(xml) ⇒ Object
36 37 38 |
# File 'lib/camt_parser/054/notification.rb', line 36 def self.parse(xml) self.new Nokogiri::XML(xml).xpath('Ntfctn') end |
Instance Method Details
#account ⇒ Object
24 25 26 |
# File 'lib/camt_parser/054/notification.rb', line 24 def account @account ||= Account.new(@xml_data.xpath('Acct').first) end |
#entries ⇒ Object
28 29 30 |
# File 'lib/camt_parser/054/notification.rb', line 28 def entries @entries ||= @xml_data.xpath('Ntry').map{ |x| Entry.new(x) } end |
#from_date_time ⇒ Object
16 17 18 |
# File 'lib/camt_parser/054/notification.rb', line 16 def from_date_time @from_date_time ||= (x = @xml_data.xpath('FrToDt/FrDtTm')).empty? ? nil : Time.parse(x.first.content) end |
#generation_date ⇒ Object
12 13 14 |
# File 'lib/camt_parser/054/notification.rb', line 12 def generation_date @generation_date ||= Time.parse(@xml_data.xpath('CreDtTm/text()').text) end |
#identification ⇒ Object
8 9 10 |
# File 'lib/camt_parser/054/notification.rb', line 8 def identification @identification ||= @xml_data.xpath('Id/text()').text end |
#source ⇒ Object
32 33 34 |
# File 'lib/camt_parser/054/notification.rb', line 32 def source @xml_data.to_s end |
#to_date_time ⇒ Object
20 21 22 |
# File 'lib/camt_parser/054/notification.rb', line 20 def to_date_time @to_date_time ||= (x = @xml_data.xpath('FrToDt/ToDtTm')).empty? ? nil : Time.parse(x.first.content) end |