Class: SepaFileParser::BatchDetail
- Inherits:
-
Object
- Object
- SepaFileParser::BatchDetail
- Defined in:
- lib/sepa_file_parser/general/batch_detail.rb
Instance Attribute Summary collapse
-
#xml_data ⇒ Object
readonly
Returns the value of attribute xml_data.
Instance Method Summary collapse
- #currency ⇒ String
-
#initialize(xml_data) ⇒ BatchDetail
constructor
A new instance of BatchDetail.
-
#msg_id ⇒ Object
(also: #message_id)
may be missing.
- #number_of_transactions ⇒ Object
- #payment_information_identification ⇒ Object
- #total_amount ⇒ Object
- #total_amount_in_cents ⇒ Object
Constructor Details
#initialize(xml_data) ⇒ BatchDetail
Returns a new instance of BatchDetail.
8 9 10 11 |
# File 'lib/sepa_file_parser/general/batch_detail.rb', line 8 def initialize(xml_data) @xml_data = xml_data @amount = xml_data.xpath('TtlAmt/text()').text end |
Instance Attribute Details
#xml_data ⇒ Object (readonly)
Returns the value of attribute xml_data.
6 7 8 |
# File 'lib/sepa_file_parser/general/batch_detail.rb', line 6 def xml_data @xml_data end |
Instance Method Details
#currency ⇒ String
22 23 24 |
# File 'lib/sepa_file_parser/general/batch_detail.rb', line 22 def currency @currency ||= xml_data.xpath('TtlAmt/@Ccy').text end |
#msg_id ⇒ Object Also known as: message_id
may be missing
30 31 32 |
# File 'lib/sepa_file_parser/general/batch_detail.rb', line 30 def msg_id # may be missing @msg_id ||= xml_data.xpath('MsgId/text()').text end |
#number_of_transactions ⇒ Object
35 36 37 |
# File 'lib/sepa_file_parser/general/batch_detail.rb', line 35 def number_of_transactions @number_of_transactions ||= xml_data.xpath('NbOfTxs/text()').text end |
#payment_information_identification ⇒ Object
26 27 28 |
# File 'lib/sepa_file_parser/general/batch_detail.rb', line 26 def payment_information_identification @payment_information_identification ||= xml_data.xpath('PmtInfId/text()').text end |
#total_amount ⇒ Object
13 14 15 |
# File 'lib/sepa_file_parser/general/batch_detail.rb', line 13 def total_amount SepaFileParser::Misc.to_amount(@amount) end |
#total_amount_in_cents ⇒ Object
17 18 19 |
# File 'lib/sepa_file_parser/general/batch_detail.rb', line 17 def total_amount_in_cents SepaFileParser::Misc.to_amount_in_cents(@amount) end |