Class: AiUsage::CostReconciler::Row
- Inherits:
-
Data
- Object
- Data
- AiUsage::CostReconciler::Row
- Defined in:
- app/services/ai_usage/cost_reconciler.rb
Overview
One model's real-vs-tracked comparison.
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#real_usd ⇒ Object
readonly
Returns the value of attribute real_usd.
-
#tracked_usd ⇒ Object
readonly
Returns the value of attribute tracked_usd.
Instance Method Summary collapse
-
#coverage_pct ⇒ Float
Tracked as a percentage of real (100.0 when real is 0).
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model
18 19 20 |
# File 'app/services/ai_usage/cost_reconciler.rb', line 18 def model @model end |
#real_usd ⇒ Object (readonly)
Returns the value of attribute real_usd
18 19 20 |
# File 'app/services/ai_usage/cost_reconciler.rb', line 18 def real_usd @real_usd end |
#tracked_usd ⇒ Object (readonly)
Returns the value of attribute tracked_usd
18 19 20 |
# File 'app/services/ai_usage/cost_reconciler.rb', line 18 def tracked_usd @tracked_usd end |
Instance Method Details
#coverage_pct ⇒ Float
Returns tracked as a percentage of real (100.0 when real is 0).
20 21 22 |
# File 'app/services/ai_usage/cost_reconciler.rb', line 20 def coverage_pct real_usd.zero? ? 100.0 : (tracked_usd / real_usd * 100).round(1) end |