Class: SepaFileParser::Charges
- Inherits:
-
Object
- Object
- SepaFileParser::Charges
- Defined in:
- lib/sepa_file_parser/general/charges.rb
Instance Attribute Summary collapse
-
#xml_data ⇒ Object
readonly
Returns the value of attribute xml_data.
Instance Method Summary collapse
-
#initialize(xml_data) ⇒ Charges
constructor
A new instance of Charges.
- #records ⇒ Object
- #total_charges_and_tax_amount ⇒ Object
- #total_charges_and_tax_amount_in_cents ⇒ Object
Constructor Details
#initialize(xml_data) ⇒ Charges
Returns a new instance of Charges.
8 9 10 11 |
# File 'lib/sepa_file_parser/general/charges.rb', line 8 def initialize(xml_data) @xml_data = xml_data @total_charges_and_tax_amount = xml_data.xpath('TtlChrgsAndTaxAmt/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/charges.rb', line 6 def xml_data @xml_data end |
Instance Method Details
#records ⇒ Object
21 22 23 |
# File 'lib/sepa_file_parser/general/charges.rb', line 21 def records @records ||= xml_data.xpath('Rcrd').map{ |x| SepaFileParser::Record.new(x) } end |
#total_charges_and_tax_amount ⇒ Object
13 14 15 |
# File 'lib/sepa_file_parser/general/charges.rb', line 13 def total_charges_and_tax_amount SepaFileParser::Misc.to_amount(@total_charges_and_tax_amount) end |
#total_charges_and_tax_amount_in_cents ⇒ Object
17 18 19 |
# File 'lib/sepa_file_parser/general/charges.rb', line 17 def total_charges_and_tax_amount_in_cents SepaFileParser::Misc.to_amount_in_cents(@total_charges_and_tax_amount) end |