Class: Daytona::Charts::CompositeChart
- Defined in:
- lib/daytona/common/charts.rb
Instance Attribute Summary collapse
-
#elements ⇒ Array<Daytona::Charts::Chart>
readonly
The charts of the composite chart.
Attributes inherited from Chart
Instance Method Summary collapse
-
#initialize(data) ⇒ CompositeChart
constructor
A new instance of CompositeChart.
- #to_h ⇒ Object
Constructor Details
#initialize(data) ⇒ CompositeChart
Returns a new instance of CompositeChart.
277 278 279 280 281 |
# File 'lib/daytona/common/charts.rb', line 277 def initialize(data) super @type = ChartType::COMPOSITE_CHART @elements = data.fetch(:elements, []).map { |e| Charts.parse(e) } end |
Instance Attribute Details
#elements ⇒ Array<Daytona::Charts::Chart> (readonly)
Returns The charts of the composite chart.
274 275 276 |
# File 'lib/daytona/common/charts.rb', line 274 def elements @elements end |
Instance Method Details
#to_h ⇒ Object
283 |
# File 'lib/daytona/common/charts.rb', line 283 def to_h = super.merge(elements: elements.map(&:to_h)) |