Class: GOBL::Extensions::Bill::ScenarioSummary
- Inherits:
-
Object
- Object
- GOBL::Extensions::Bill::ScenarioSummary
- Defined in:
- lib/gobl/extensions/bill/scenario_summary.rb
Overview
Aggregates the data of collection of scenarios
Instance Method Summary collapse
-
#codes ⇒ Object
Returns the aggregated codes of the scenarios.
-
#initialize(scenarios) ⇒ ScenarioSummary
constructor
A new instance of ScenarioSummary.
Constructor Details
#initialize(scenarios) ⇒ ScenarioSummary
Returns a new instance of ScenarioSummary.
8 9 10 |
# File 'lib/gobl/extensions/bill/scenario_summary.rb', line 8 def initialize(scenarios) @scenarios = scenarios end |
Instance Method Details
#codes ⇒ Object
Returns the aggregated codes of the scenarios
13 14 15 16 17 |
# File 'lib/gobl/extensions/bill/scenario_summary.rb', line 13 def codes scenarios.inject({}) do |codes, scenario| codes.merge(scenario.codes.to_h) end end |