Sha256: 0ae1c8e7cb8e3edb386df6230551ff8fd16d3c151dd7ba06576b385e2bfb75ab

Contents?: true

Size: 778 Bytes

Versions: 36

Compression:

Stored size: 778 Bytes

Contents

require 'quby/compiler/entities/charting/overview_chart'
require_relative 'chart_builder'

module Quby
  module Compiler
    module DSL
      class OverviewChartBuilder < ChartBuilder
        set_chart_class(Entities::Charting::OverviewChart)

        def initialize(questionnaire, **options)
          @questionnaire = questionnaire
          @chart = self.class.chart_class.new
        end

        def subscore(key)
          @chart.subscore = key
        end

        def y_max(value)
          @chart.y_max = value
        end

        def validate!
          fail ArgumentError, "subscore not specified" unless @chart.subscore.present?
          fail ArgumentError, "y_max not specified" unless @chart.y_max.present?
          true
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
quby-compiler-0.5.14 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.5.13 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.5.12 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.5.11 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.5.9 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.5.8 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.5.7 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.5.6 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.5.5 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.5.4 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.5.3 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.5.2 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.5.1 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.5.0 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.4.16 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.4.15 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.4.14 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.4.13 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.4.12 lib/quby/compiler/dsl/charting/overview_chart_builder.rb
quby-compiler-0.4.11 lib/quby/compiler/dsl/charting/overview_chart_builder.rb