Class: Aba::Return
- Includes:
- Validations
- Defined in:
- lib/aba/return.rb
Constant Summary
Constants included from Validations
Validations::BECS_PATTERN, Validations::CREDIT_TRANSACTION_CODES, Validations::DEBIT_TRANSACTION_CODES, Validations::INDICATORS
Instance Attribute Summary collapse
-
#account_name ⇒ Object
Returns the value of attribute account_name.
-
#account_number ⇒ Object
Allow dashes to be input, but remove them from output.
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#bsb ⇒ Object
Returns the value of attribute bsb.
-
#lodgement_reference ⇒ Object
Returns the value of attribute lodgement_reference.
-
#name_of_remitter ⇒ Object
Returns the value of attribute name_of_remitter.
-
#original_processing_day ⇒ Object
Returns the value of attribute original_processing_day.
-
#original_user_id ⇒ Object
Returns the value of attribute original_user_id.
-
#return_code ⇒ Object
Returns the value of attribute return_code.
-
#trace_account_number ⇒ Object
Returns the value of attribute trace_account_number.
-
#trace_bsb ⇒ Object
Returns the value of attribute trace_bsb.
-
#transaction_code ⇒ Object
Returns the value of attribute transaction_code.
Attributes included from Validations
Instance Method Summary collapse
Methods included from Validations
included, transaction_codes, #valid?
Methods inherited from Entry
#credit?, #debit?, #initialize
Constructor Details
This class inherits a constructor from Aba::Entry
Instance Attribute Details
#account_name ⇒ Object
Returns the value of attribute account_name.
7 8 9 |
# File 'lib/aba/return.rb', line 7 def account_name @account_name end |
#account_number ⇒ Object
Allow dashes to be input, but remove them from output
51 52 53 |
# File 'lib/aba/return.rb', line 51 def account_number @account_number end |
#amount ⇒ Object
Returns the value of attribute amount.
7 8 9 |
# File 'lib/aba/return.rb', line 7 def amount @amount end |
#bsb ⇒ Object
Returns the value of attribute bsb.
7 8 9 |
# File 'lib/aba/return.rb', line 7 def bsb @bsb end |
#lodgement_reference ⇒ Object
Returns the value of attribute lodgement_reference.
7 8 9 |
# File 'lib/aba/return.rb', line 7 def lodgement_reference @lodgement_reference end |
#name_of_remitter ⇒ Object
Returns the value of attribute name_of_remitter.
7 8 9 |
# File 'lib/aba/return.rb', line 7 def name_of_remitter @name_of_remitter end |
#original_processing_day ⇒ Object
Returns the value of attribute original_processing_day.
7 8 9 |
# File 'lib/aba/return.rb', line 7 def original_processing_day @original_processing_day end |
#original_user_id ⇒ Object
Returns the value of attribute original_user_id.
7 8 9 |
# File 'lib/aba/return.rb', line 7 def original_user_id @original_user_id end |
#return_code ⇒ Object
Returns the value of attribute return_code.
7 8 9 |
# File 'lib/aba/return.rb', line 7 def return_code @return_code end |
#trace_account_number ⇒ Object
Returns the value of attribute trace_account_number.
7 8 9 |
# File 'lib/aba/return.rb', line 7 def trace_account_number @trace_account_number end |
#trace_bsb ⇒ Object
Returns the value of attribute trace_bsb.
7 8 9 |
# File 'lib/aba/return.rb', line 7 def trace_bsb @trace_bsb end |
#transaction_code ⇒ Object
Returns the value of attribute transaction_code.
7 8 9 |
# File 'lib/aba/return.rb', line 7 def transaction_code @transaction_code end |
Instance Method Details
#to_s ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/aba/return.rb', line 55 def to_s raise 'Transaction data is invalid - check the contents of `errors`' unless valid? format('2%-7s%9s%1d%2d%010d%-32s%-18s%-7s%9s%-16s%02d%6s', bsb, account_number, return_code, transaction_code, amount.to_i.abs, account_name, lodgement_reference, trace_bsb, trace_account_number, name_of_remitter, original_processing_day.to_i, original_user_id) end |