Class: Bankscrap::Transaction
- Inherits:
-
Object
- Object
- Bankscrap::Transaction
- Includes:
- Utils::Inspectable
- Defined in:
- lib/bankscrap/transaction.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#balance ⇒ Object
Returns the value of attribute balance.
-
#description ⇒ Object
Returns the value of attribute description.
-
#description_detail ⇒ Object
Returns the value of attribute description_detail.
-
#effective_date ⇒ Object
Returns the value of attribute effective_date.
-
#id ⇒ Object
Returns the value of attribute id.
-
#operation_date ⇒ Object
Returns the value of attribute operation_date.
Instance Method Summary collapse
- #currency ⇒ Object
-
#initialize(params = {}) ⇒ Transaction
constructor
A new instance of Transaction.
- #to_a ⇒ Object
- #to_s ⇒ Object
Methods included from Utils::Inspectable
Constructor Details
#initialize(params = {}) ⇒ Transaction
Returns a new instance of Transaction.
7 8 9 10 11 |
# File 'lib/bankscrap/transaction.rb', line 7 def initialize(params = {}) raise NotMoneyObjectError, :amount unless params[:amount].is_a?(Money) params.each { |key, value| send "#{key}=", value } end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
5 6 7 |
# File 'lib/bankscrap/transaction.rb', line 5 def account @account end |
#amount ⇒ Object
Returns the value of attribute amount.
5 6 7 |
# File 'lib/bankscrap/transaction.rb', line 5 def amount @amount end |
#balance ⇒ Object
Returns the value of attribute balance.
5 6 7 |
# File 'lib/bankscrap/transaction.rb', line 5 def balance @balance end |
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/bankscrap/transaction.rb', line 5 def description @description end |
#description_detail ⇒ Object
Returns the value of attribute description_detail.
5 6 7 |
# File 'lib/bankscrap/transaction.rb', line 5 def description_detail @description_detail end |
#effective_date ⇒ Object
Returns the value of attribute effective_date.
5 6 7 |
# File 'lib/bankscrap/transaction.rb', line 5 def effective_date @effective_date end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/bankscrap/transaction.rb', line 5 def id @id end |
#operation_date ⇒ Object
Returns the value of attribute operation_date.
5 6 7 |
# File 'lib/bankscrap/transaction.rb', line 5 def operation_date @operation_date end |
Instance Method Details
#currency ⇒ Object
21 22 23 |
# File 'lib/bankscrap/transaction.rb', line 21 def currency amount.currency end |
#to_a ⇒ Object
17 18 19 |
# File 'lib/bankscrap/transaction.rb', line 17 def to_a [id, effective_date.strftime('%d/%m/%Y'), description, description_detail, amount] end |
#to_s ⇒ Object
13 14 15 |
# File 'lib/bankscrap/transaction.rb', line 13 def to_s description end |