Class: Aba
- Inherits:
-
Object
- Object
- Aba
- Includes:
- Validations
- Defined in:
- lib/aba.rb,
lib/aba/version.rb,
lib/aba/transaction.rb,
lib/aba/validations.rb
Defined Under Namespace
Modules: Validations Classes: Transaction
Constant Summary collapse
- VERSION =
"0.3.1"
Instance Attribute Summary collapse
-
#bsb ⇒ Object
Returns the value of attribute bsb.
-
#description ⇒ Object
Returns the value of attribute description.
-
#financial_institution ⇒ Object
Returns the value of attribute financial_institution.
-
#process_at ⇒ Object
Returns the value of attribute process_at.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
-
#user_name ⇒ Object
Returns the value of attribute user_name.
Attributes included from Validations
Instance Method Summary collapse
- #add_transaction(transaction) ⇒ Object
-
#initialize(attrs = {}) {|_self| ... } ⇒ Aba
constructor
A new instance of Aba.
- #to_s ⇒ Object
Methods included from Validations
Constructor Details
#initialize(attrs = {}) {|_self| ... } ⇒ Aba
Returns a new instance of Aba.
19 20 21 22 23 24 25 26 27 |
# File 'lib/aba.rb', line 19 def initialize(attrs = {}) attrs.each do |key, value| send("#{key}=", value) end @transactions = [] yield self if block_given? end |
Instance Attribute Details
#bsb ⇒ Object
Returns the value of attribute bsb.
8 9 10 |
# File 'lib/aba.rb', line 8 def bsb @bsb end |
#description ⇒ Object
Returns the value of attribute description.
8 9 10 |
# File 'lib/aba.rb', line 8 def description @description end |
#financial_institution ⇒ Object
Returns the value of attribute financial_institution.
8 9 10 |
# File 'lib/aba.rb', line 8 def financial_institution @financial_institution end |
#process_at ⇒ Object
Returns the value of attribute process_at.
8 9 10 |
# File 'lib/aba.rb', line 8 def process_at @process_at end |
#user_id ⇒ Object
Returns the value of attribute user_id.
8 9 10 |
# File 'lib/aba.rb', line 8 def user_id @user_id end |
#user_name ⇒ Object
Returns the value of attribute user_name.
8 9 10 |
# File 'lib/aba.rb', line 8 def user_name @user_name end |
Instance Method Details
#add_transaction(transaction) ⇒ Object
40 41 42 |
# File 'lib/aba.rb', line 40 def add_transaction(transaction) @transactions << transaction end |
#to_s ⇒ Object
29 30 31 32 33 34 35 36 37 38 |
# File 'lib/aba.rb', line 29 def to_s # Descriptive record output = "#{descriptive_record}\r\n" # Transactions records output += @transactions.map{ |t| t.to_s }.join("\r\n") # Batch control record output += "\r\n#{batch_control_record}" end |