Class: LlmCostTracker::Ledger::Rollups::Batch
- Inherits:
-
Object
- Object
- LlmCostTracker::Ledger::Rollups::Batch
- Defined in:
- lib/llm_cost_tracker/ledger/rollups/batch.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(events) ⇒ Batch
constructor
A new instance of Batch.
- #rows ⇒ Object
Constructor Details
#initialize(events) ⇒ Batch
Returns a new instance of Batch.
15 16 17 |
# File 'lib/llm_cost_tracker/ledger/rollups/batch.rb', line 15 def initialize(events) @events = events end |
Class Method Details
.rows(events) ⇒ Object
11 12 13 |
# File 'lib/llm_cost_tracker/ledger/rollups/batch.rb', line 11 def self.rows(events) new(events).rows end |
Instance Method Details
#rows ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/llm_cost_tracker/ledger/rollups/batch.rb', line 19 def rows totals.map do |(period, period_start), total_cost| { period: period, period_start: period_start, total_cost: total_cost } end end |