Class: Ballista::Projection
- Inherits:
-
Object
- Object
- Ballista::Projection
- Defined in:
- lib/ballista/projection.rb
Overview
Projection class for creating journals
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Projection
constructor
A new instance of Projection.
- #project(start_dt, end_dt) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Projection
Returns a new instance of Projection.
8 9 10 |
# File 'lib/ballista/projection.rb', line 8 def initialize(params = {}) @entries = params[:entries] end |
Instance Method Details
#project(start_dt, end_dt) ⇒ Object
12 13 14 15 |
# File 'lib/ballista/projection.rb', line 12 def project(start_dt, end_dt) entries = start_dt.upto(end_dt).map { |date| parse_day(date) } Ledger.new(entries: entries.flatten) end |