Class: BlankTransaction
- Inherits:
-
Object
- Object
- BlankTransaction
- Defined in:
- app/models/blank_transaction.rb
Instance Attribute Summary collapse
-
#account_from ⇒ Object
Returns the value of attribute account_from.
-
#account_to ⇒ Object
Returns the value of attribute account_to.
-
#amount ⇒ Object
Returns the value of attribute amount.
Instance Method Summary collapse
-
#initialize(amount, account_from) ⇒ BlankTransaction
constructor
A new instance of BlankTransaction.
- #to(account_to, args = {}) ⇒ Object
Constructor Details
#initialize(amount, account_from) ⇒ BlankTransaction
Returns a new instance of BlankTransaction.
4 5 6 7 |
# File 'app/models/blank_transaction.rb', line 4 def initialize(amount, account_from) @amount = amount @account_from = account_from end |
Instance Attribute Details
#account_from ⇒ Object
Returns the value of attribute account_from.
2 3 4 |
# File 'app/models/blank_transaction.rb', line 2 def account_from @account_from end |
#account_to ⇒ Object
Returns the value of attribute account_to.
2 3 4 |
# File 'app/models/blank_transaction.rb', line 2 def account_to @account_to end |
#amount ⇒ Object
Returns the value of attribute amount.
2 3 4 |
# File 'app/models/blank_transaction.rb', line 2 def amount @amount end |
Instance Method Details
#to(account_to, args = {}) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'app/models/blank_transaction.rb', line 9 def to(account_to, args = {}) defaults = { :account_from => @account_from, :account_to => account_to, :amount => @amount } Transaction.create args.merge(defaults) end |