class CamtParser::Format054::Notification

Attributes

xml_data[R]

Public Class Methods

new(xml_data) click to toggle source
# File lib/camt_parser/054/notification.rb, line 7
def initialize(xml_data)
  @xml_data = xml_data
end
parse(xml) click to toggle source

@return [CamtParser::Format054::Notification]

# File lib/camt_parser/054/notification.rb, line 47
def self.parse(xml)
  self.new Nokogiri::XML(xml).xpath('Ntfctn')
end

Public Instance Methods

account() click to toggle source

@return [Account]

# File lib/camt_parser/054/notification.rb, line 32
def account
  @account ||= Account.new(xml_data.xpath('Acct').first)
end
entries() click to toggle source

@return [Array<Entry>]

# File lib/camt_parser/054/notification.rb, line 37
def entries
  @entries ||= xml_data.xpath('Ntry').map{ |x| Entry.new(x) }
end
from_date_time() click to toggle source

@return [Time, nil]

# 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
generation_date() click to toggle source

@return [Time]

# File lib/camt_parser/054/notification.rb, line 17
def generation_date
  @generation_date ||= Time.parse(xml_data.xpath('CreDtTm/text()').text)
end
identification() click to toggle source

@return [String]

# File lib/camt_parser/054/notification.rb, line 12
def identification
  @identification ||= xml_data.xpath('Id/text()').text
end
source() click to toggle source

@return [String]

# File lib/camt_parser/054/notification.rb, line 42
def source
  xml_data.to_s
end
to_date_time() click to toggle source

@return [Time, nil]

# 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