lib/chart_js/chart/opts.rb in chart_js-1.0.1pre vs lib/chart_js/chart/opts.rb in chart_js-1.1.0

- old
+ new

@@ -1,16 +1,23 @@ -require_relative "dataset.rb" - module ChartJS - class Options + class Opts def initialize @container = Hash.new end - + def build(&block) instance_eval(&block) + @container + end + + def cutout(value = nil) + return @container['cutoutPercentage'] if value.nil? + @container['cutoutPercentage'] = value + end + + def to_h @container end end