Class: Aloe::Reports::AccountsList
- Inherits:
-
Object
- Object
- Aloe::Reports::AccountsList
- Defined in:
- lib/aloe/reports/accounts_list.rb
Instance Attribute Summary collapse
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
Instance Method Summary collapse
- #body ⇒ Object
- #footer ⇒ Object
- #header ⇒ Object
-
#initialize(currency = Money.default_currency.to_s) ⇒ AccountsList
constructor
A new instance of AccountsList.
Constructor Details
#initialize(currency = Money.default_currency.to_s) ⇒ AccountsList
Returns a new instance of AccountsList.
7 8 9 |
# File 'lib/aloe/reports/accounts_list.rb', line 7 def initialize(currency = Money.default_currency.to_s) @currency = currency end |
Instance Attribute Details
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
5 6 7 |
# File 'lib/aloe/reports/accounts_list.rb', line 5 def currency @currency end |
Instance Method Details
#body ⇒ Object
15 16 17 18 19 20 |
# File 'lib/aloe/reports/accounts_list.rb', line 15 def body accounts.map do |a| type = a.name? ? 'System' : 'Entity' [type, a.id, a.name, a.owner_type_and_id, a.currency, a.balance.format] end end |
#footer ⇒ Object
22 23 24 |
# File 'lib/aloe/reports/accounts_list.rb', line 22 def ['', '', '', '', '', trial_balance.format] end |
#header ⇒ Object
11 12 13 |
# File 'lib/aloe/reports/accounts_list.rb', line 11 def header ['Type', 'Id', 'Name', 'Owner', 'Currency', 'Balance'] end |