Class: StarlingTerminal::TransactionRow
- Inherits:
-
Object
- Object
- StarlingTerminal::TransactionRow
- Defined in:
- lib/starling_terminal/transaction_row.rb
Overview
A presenter to convert Starling::Resources::TransactionResource instances to presented rows for our transactions table
Class Method Summary collapse
-
.present(transaction) ⇒ Array<String>
Converts a Starling Bank transaction into a row to be displayed in our transactions table.
Class Method Details
.present(transaction) ⇒ Array<String>
Converts a Starling Bank transaction into a row to be displayed in our transactions table
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/starling_terminal/transaction_row.rb', line 15 def self.present(transaction) amount = transaction.amount [ transaction.narrative, Utils.float_to_currency(amount, currency: transaction.currency) .colorize(Utils.colour_for_amount(amount)), Utils.present_time(transaction.created), transaction.source.to_s ] end |