Class: BankPayments::SwedbankImport::MoneyRecord
- Inherits:
-
BankPayments::SpisuRecord
- Object
- BankPayments::SpisuRecord
- BankPayments::SwedbankImport::MoneyRecord
- Defined in:
- lib/bank_payments/swedbank_import/money_record.rb
Instance Method Summary collapse
- #amount_foreign ⇒ Object
- #amount_sek ⇒ Object
- #bank_amount_sek ⇒ Object
- #corrected_by_bank? ⇒ Boolean
-
#error_code ⇒ Object
Enum with ‘0’ = OK ‘1’ = Payment corrected by the bank.
-
#initialize(raw_record) ⇒ MoneyRecord
constructor
A new instance of MoneyRecord.
-
#recalculation_code ⇒ Object
Enum with ‘0’ => The bank has calculated it’s value from the foreign amount’ ‘9’ => The bank has calculated it’s value form the SEK amount.
Methods inherited from BankPayments::SpisuRecord
define_field, defined_fields, definition_for, #extract_date, #extract_field_value, #extract_raw_value, inherited, #method_missing, #serialize_value, #set_numeric_value, #set_text_value, #set_value, #to_s, #type, #type=
Constructor Details
#initialize(raw_record) ⇒ MoneyRecord
13 14 15 16 |
# File 'lib/bank_payments/swedbank_import/money_record.rb', line 13 def initialize(raw_record) super self.type = '5' end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class BankPayments::SpisuRecord
Instance Method Details
#amount_foreign ⇒ Object
30 31 32 |
# File 'lib/bank_payments/swedbank_import/money_record.rb', line 30 def amount_foreign AmountConverter.value_to_decimal(extract_raw_value __callee__) end |
#amount_sek ⇒ Object
22 23 24 |
# File 'lib/bank_payments/swedbank_import/money_record.rb', line 22 def amount_sek AmountConverter.value_to_decimal(extract_raw_value __callee__) end |
#bank_amount_sek ⇒ Object
26 27 28 |
# File 'lib/bank_payments/swedbank_import/money_record.rb', line 26 def bank_amount_sek AmountConverter.value_to_decimal(extract_raw_value __callee__) end |
#corrected_by_bank? ⇒ Boolean
18 19 20 |
# File 'lib/bank_payments/swedbank_import/money_record.rb', line 18 def corrected_by_bank? error_code == '1' end |
#error_code ⇒ Object
Enum with ‘0’ = OK ‘1’ = Payment corrected by the bank
44 45 46 |
# File 'lib/bank_payments/swedbank_import/money_record.rb', line 44 def error_code extract_raw_value __callee__ end |
#recalculation_code ⇒ Object
Enum with ‘0’ => The bank has calculated it’s value from the foreign amount’ ‘9’ => The bank has calculated it’s value form the SEK amount
37 38 39 |
# File 'lib/bank_payments/swedbank_import/money_record.rb', line 37 def recalculation_code extract_raw_value __callee__ end |