Class: Aba::Return

Inherits:
Entry
  • Object
show all
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

Attributes included from Validations

#error_collection

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_nameObject

Returns the value of attribute account_name.



7
8
9
# File 'lib/aba/return.rb', line 7

def 
  @account_name
end

#account_numberObject

Allow dashes to be input, but remove them from output



51
52
53
# File 'lib/aba/return.rb', line 51

def 
  @account_number
end

#amountObject

Returns the value of attribute amount.



7
8
9
# File 'lib/aba/return.rb', line 7

def amount
  @amount
end

#bsbObject

Returns the value of attribute bsb.



7
8
9
# File 'lib/aba/return.rb', line 7

def bsb
  @bsb
end

#lodgement_referenceObject

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_remitterObject

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_dayObject

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_idObject

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_codeObject

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_numberObject

Returns the value of attribute trace_account_number.



7
8
9
# File 'lib/aba/return.rb', line 7

def 
  @trace_account_number
end

#trace_bsbObject

Returns the value of attribute trace_bsb.



7
8
9
# File 'lib/aba/return.rb', line 7

def trace_bsb
  @trace_bsb
end

#transaction_codeObject

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_sObject



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,
         ,
         return_code,
         transaction_code,
         amount.to_i.abs,
         ,
         lodgement_reference,
         trace_bsb,
         ,
         name_of_remitter,
         original_processing_day.to_i,
         original_user_id)
end