lib/suricate/widgets/responses/chart_widget_response.rb in suricate-0.0.2 vs lib/suricate/widgets/responses/chart_widget_response.rb in suricate-0.0.3
- old
+ new
@@ -1,17 +1,20 @@
require 'delegate'
module Suricate
- class ChartWidgetResponse
+ class ChartWidgetResponse < WidgetResponse
def initialize
@builder = ChartBuilder.new
+ super
end
def chart
yield @builder
end
def to_h
- { chart: @builder.chart.to_h }
+ super.tap do |hash|
+ hash.merge!(chart: @builder.chart.to_h)
+ end
end
end
end