Class: ExtrasDeCont::Transaction
- Inherits:
-
Object
- Object
- ExtrasDeCont::Transaction
- Defined in:
- lib/extras_de_cont/transaction.rb
Overview
Models a simple bank transaction
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
Instance Method Summary collapse
-
#initialize(date, description, amount, currency) ⇒ Transaction
constructor
A new instance of Transaction.
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
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
6 7 8 |
# File 'lib/extras_de_cont/transaction.rb', line 6 def amount @amount end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
6 7 8 |
# File 'lib/extras_de_cont/transaction.rb', line 6 def currency @currency end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
6 7 8 |
# File 'lib/extras_de_cont/transaction.rb', line 6 def date @date end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/extras_de_cont/transaction.rb', line 6 def description @description end |