Class: ExtrasDeCont::Transaction

Inherits:
Object
  • Object
show all
Defined in:
lib/extras_de_cont/transaction.rb

Overview

Models a simple bank transaction

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(date, description, amount, currency) ⇒ Transaction

Returns a new instance of Transaction.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/extras_de_cont/transaction.rb', line 8

def initialize(
  date,
  description,
  amount,
  currency
)
  @date = date
  @description = description
  @amount = amount
  @currency = currency
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



6
7
8
# File 'lib/extras_de_cont/transaction.rb', line 6

def amount
  @amount
end

#currencyObject (readonly)

Returns the value of attribute currency.



6
7
8
# File 'lib/extras_de_cont/transaction.rb', line 6

def currency
  @currency
end

#dateObject (readonly)

Returns the value of attribute date.



6
7
8
# File 'lib/extras_de_cont/transaction.rb', line 6

def date
  @date
end

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/extras_de_cont/transaction.rb', line 6

def description
  @description
end