Class: CamtParser::Charges
- Inherits:
-
Object
- Object
- CamtParser::Charges
- Defined in:
- lib/camt_parser/general/charges.rb
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.
3 4 5 6 |
# File 'lib/camt_parser/general/charges.rb', line 3 def initialize(xml_data) @xml_data = xml_data @total_charges_and_tax_amount = @xml_data.xpath('TtlChrgsAndTaxAmt/text()').text end |
Instance Method Details
#records ⇒ Object
16 17 18 |
# File 'lib/camt_parser/general/charges.rb', line 16 def records @records ||= @xml_data.xpath('Rcrd').map{ |x| CamtParser::Record.new(x) } end |
#total_charges_and_tax_amount ⇒ Object
8 9 10 |
# File 'lib/camt_parser/general/charges.rb', line 8 def total_charges_and_tax_amount CamtParser::Misc.to_amount(@total_charges_and_tax_amount) end |
#total_charges_and_tax_amount_in_cents ⇒ Object
12 13 14 |
# File 'lib/camt_parser/general/charges.rb', line 12 def total_charges_and_tax_amount_in_cents CamtParser::Misc.to_amount_in_cents(@total_charges_and_tax_amount) end |