Class: InstanceAccountant::JournalEntry
- Inherits:
-
Object
- Object
- InstanceAccountant::JournalEntry
- Defined in:
- lib/instance_accountant/journal_entry.rb
Instance Method Summary collapse
- #hash_for(hour, now) ⇒ Object
-
#initialize(options = { }) ⇒ JournalEntry
constructor
A new instance of JournalEntry.
Constructor Details
#initialize(options = { }) ⇒ JournalEntry
Returns a new instance of JournalEntry.
6 7 8 9 10 |
# File 'lib/instance_accountant/journal_entry.rb', line 6 def initialize = { } = @subledger = [:subledger] || Subledger.new(.dup) end |
Instance Method Details
#hash_for(hour, now) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/instance_accountant/journal_entry.rb', line 12 def hash_for hour, now hour_string = hour.hour_string lines = cost_lines hour_string lines += price_lines(hour_string) if include_price_lines? hash = { effective_at: now, description: description(hour_string), lines: lines } hash.merge!(reference: [:reference]) if [:reference] hash end |