Class: BanksApi::Transaction
- Inherits:
-
Object
- Object
- BanksApi::Transaction
- Defined in:
- lib/banks_api/transaction.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#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.
9 10 11 12 13 |
# File 'lib/banks_api/transaction.rb', line 9 def initialize(date:, description:, amount:, currency:) @date = date @description = description @amount = Money.from_amount(amount, currency) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
7 8 9 |
# File 'lib/banks_api/transaction.rb', line 7 def amount @amount end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
7 8 9 |
# File 'lib/banks_api/transaction.rb', line 7 def date @date end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
7 8 9 |
# File 'lib/banks_api/transaction.rb', line 7 def description @description end |