Class: BankScrap::Transaction

Inherits:
Object
  • Object
show all
Includes:
Utils::Inspectable
Defined in:
lib/bank_scrap/transaction.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::Inspectable

#inspect

Constructor Details

#initialize(params = {}) ⇒ Transaction



9
10
11
# File 'lib/bank_scrap/transaction.rb', line 9

def initialize(params = {})
  params.each{ |key, value| send "#{key}=", value }
end

Instance Attribute Details

#account ⇒ Object

Returns the value of attribute account.



5
6
7
# File 'lib/bank_scrap/transaction.rb', line 5

def 
  @account
end

#amount ⇒ Object

Returns the value of attribute amount.



5
6
7
# File 'lib/bank_scrap/transaction.rb', line 5

def amount
  @amount
end

#balance ⇒ Object

Returns the value of attribute balance.



5
6
7
# File 'lib/bank_scrap/transaction.rb', line 5

def balance
  @balance
end

#currency ⇒ Object

Returns the value of attribute currency.



5
6
7
# File 'lib/bank_scrap/transaction.rb', line 5

def currency
  @currency
end

#description ⇒ Object

Returns the value of attribute description.



5
6
7
# File 'lib/bank_scrap/transaction.rb', line 5

def description
  @description
end

#effective_date ⇒ Object

Returns the value of attribute effective_date.



5
6
7
# File 'lib/bank_scrap/transaction.rb', line 5

def effective_date
  @effective_date
end

#id ⇒ Object

Returns the value of attribute id.



5
6
7
# File 'lib/bank_scrap/transaction.rb', line 5

def id
  @id
end

Instance Method Details

#to_s ⇒ Object



13
14
15
# File 'lib/bank_scrap/transaction.rb', line 13

def to_s
  "#{effective_date.strftime("%d/%m/%Y")}   #{description.ljust(45)} #{amount.format.rjust(20)}"
end