Class: BlankTransaction

Inherits:
Object
  • Object
show all
Defined in:
app/models/blank_transaction.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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, )
  @amount = amount
  @account_from = 
end

Instance Attribute Details

#account_fromObject

Returns the value of attribute account_from.



2
3
4
# File 'app/models/blank_transaction.rb', line 2

def 
  @account_from
end

#account_toObject

Returns the value of attribute account_to.



2
3
4
# File 'app/models/blank_transaction.rb', line 2

def 
  @account_to
end

#amountObject

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(, args = {})
  defaults = {
    :account_from => @account_from,
    :account_to => ,
    :amount => @amount
  }
  Transaction.create args.merge(defaults) 
end